fix(cli): sanitizePathForDisplay keeps Unicode format characters such as bidi overrides
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 internal/cli/uninit.go 中的 sanitizePathForDisplay 开始,它会删除 unicode.IsControl 为 true 的 rune;同时查看 internal/cli/present/sanitize.go 中重复的 sanitizeControl。在两者中都添加 unicode.Cf 或双向控制字符检查,然后为每个辅助函数的测试添加一个 Cf 用例。当输出中去除了 U+202E 和 U+200B,且现有测试仍然通过时,即为完成。
由索引模型根据 Issue 内容生成。
描述
sanitizePathForDisplay (internal/cli/uninit.go) removes the runes for which unicode.IsControl is true. That is Unicode category Cc only. Category Cf runes pass through, for example U+202E RIGHT-TO-LEFT OVERRIDE and U+200B ZERO WIDTH SPACE. A path that holds them can display as a different path from the one on disk.
Every CLI path display goes through this helper, including the skipped-registry-file warning that the #155 change adds. internal/cli/present/sanitize.go keeps a duplicate, sanitizeControl, with the same rule.
Severity
Low. Display only, and the helper was written this way before #155. Someone who can name a file the CLI prints can already show the user a misleading name. The fix stops the display from hiding it.
What to do
- Also drop
unicode.Is(unicode.Cf, r)runes, or at least the bidi controls (U+202A–U+202E, U+2066–U+2069), in both helpers. - Add a Cf case to each helper's test.
Found by the security reviewer in the suite review of the #155 implementation branch (information level).
🤖 Generated with Claude Code
- 主要语言
- Go
- 星标
- 0
- 派生
- 0
- 平均合并
- 7 小时 42 分钟
- 30 天内合并 PR
- 111
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
seanb4t/codegraph-go 的其他 Issue
-
chore needs-triage
难度 1/5 1 小时以内 新手友好度 88/100
seanb4t/codegraph-go#380 ·
维护者通常 1 天内回复
-
chore needs-triage
难度 2/5 1-3 小时 新手友好度 82/100
seanb4t/codegraph-go#379 ·
维护者通常 1 天内回复
-
area:query chore needs-triage spec-needed
难度 2/5 1-3 小时 新手友好度 74/100
seanb4t/codegraph-go#377 ·
维护者通常 1 天内回复
-
chore needs-triage
难度 1/5 1-3 小时 新手友好度 84/100
seanb4t/codegraph-go#362 ·
维护者通常 1 天内回复
-
area:query bug needs-triage
难度 2/5 1-3 小时 新手友好度 80/100
seanb4t/codegraph-go#355 ·
维护者通常 1 天内回复
查看 seanb4t/codegraph-go 的全部 Issue
相似的 Issue
-
go-vulnerability security-scan
难度 1/5 1 小时以内 新手友好度 84/100
teslashibe/agent-go#35 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
alecthomas/chroma#1498 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 8 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复