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
星标
59
派生
74
平均合并
5 天 17 小时
30 天内合并 PR
22

环境准备

  • 没有 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 摘要。