Markdown report does not escape bare URLs, so GitHub renders them as links

未关闭 适合新手
#199 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, go

调研方向

从 internal/report/markdown.go:145-157 及其契约注释开始,然后检查 mdInline 的报告测试和 golden 文件。为 https://、http:// 和 www. 输入添加覆盖,并更新受影响的 golden 文件。这些输入不再渲染为自动链接且测试通过后,即算完成。

由索引模型根据 Issue 内容生成。

描述

bug good first issue severity: low

Summary

The markdown renderer escapes markdown punctuation but leaves www., http:// and https:// intact, and GitHub-flavored Markdown turns those into links. The renderer's own contract is that text from the target is never written raw.

Where

  • internal/report/markdown.go:8 (contract comment)
  • internal/report/markdown.go:145-157 (mdInline)
  • internal/report/doc.go:229, internal/engine/run.go:535 (notes with target paths)
  • action.yml:264 (report appended to the job summary)

Details

The escaped set covers \, backtick, *, _, brackets, angle brackets, |, #, ~, !, &, $ and @. None of ., : or / is escaped, so GFM extended autolinks still match. No test in internal/report mentions autolinks. Checked against the GFM specification, not in a browser.

Impact

A file name, finding title or note taken from scanned content can appear as a clickable link in the markdown report and in the job summary. No markup or script is involved; the effect is limited to links.

Steps to reproduce

  1. Commit a file larger than 1 MiB named www.example.org and run spackle scan . --format markdown.
  2. The report contains a "Not read: www.example.org" note, which GitHub renders with the name as a link.

Suggested fix

In mdInline, break the autolink triggers: write www\. for a www. at a word start and \: for the colon of :// (a backslash before ASCII punctuation is dropped by the renderer and stops the autolink match).

Acceptance criteria

  • A test with https://, http:// and www. inputs asserts the output does not autolink
  • Golden files are updated and the diff is explained

Related: #45, #129

Getting started

  • Relevant files: action.yml, internal/report/doc.go, internal/report/markdown.go
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: bug|internal/report/markdown.go|mdInline

主要语言
Go
星标
0
派生
1
平均合并
8 小时 14 分钟
30 天内合并 PR
3

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/Spackle 的其他 Issue

查看 TMHSDigital/Spackle 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。