Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Bug: `testEndpoint` URL Scheme Not Validated

未關閉 適合新手
#598 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
88/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go
領域
cli, security

研究方向

從 cmd/test.go 中的 testEndpoint 開始;確認 flag 值在交給 Microcks API 之前是在哪裡讀取的。用 url.Parse 解析它,拒絕 http 和 https 以外的 scheme,並為 microcks test 新增或更新命令層級測試。完成的標準是:無效 scheme 在用戶端於任何 API 呼叫之前失敗,而有效的 HTTP 和 HTTPS 端點仍然可用。

由索引模型根據 Issue 內容生成。

描述

Describe the bug
testEndpoint URL Scheme Not Validated
Description

In cmd/test.go, testEndpoint is only validated for non-emptiness and leading hyphens. The string is not parsed with url.Parse, nor is its scheme validated against an allowlist (http, https). Users can pass arbitrary URIs such as file:///etc/passwd, ftp://..., or cloud metadata endpoints (http://169.254.169.254/latest/meta-data), causing the remote Microcks server to initiate unintended network requests.

Steps to Reproduce
  1. Execute a test targeting cloud metadata:
    microcks.exe test "API:1.0" "http://169.254.169.254/latest/meta-data/" HTTP --microcksURL http://localhost:8080/api
    
  2. The CLI passes the endpoint directly to the Microcks API without client-side scheme validation.
Recommended Fix

Parse testEndpoint with url.Parse and enforce that u.Scheme is either "http" or "https".


主要語言
Go
星號
58
分支
72
平均合併
4 天 7 小時
30 天內合併 PR
24

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microcks/microcks-cli 的其他 Issue

查看 microcks/microcks-cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。