You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: markdown renderer autolink neutralization bypass via HTML character references #321
neutralizeAutolinks (internal/aireport/render_markdown.go:223) defangs only literal autolink trigger bytes (://, bare @, www.) in tool-rendered markdown. cmark-gfm (GitHub Step Summaries) resolves HTML character references (w, @, ., :, ., …) into text nodes during inline parsing, before the autolink extension post-processes the inline tree. An attacker-controlled value — e.g. a branch named www.evil.example or user@host.example — therefore reconstructs its trigger after byte-level defanging and still linkifies.
Impact
Verified live on the PR #314 branch after commit f764b07 pinned literal-trigger defanging: values echoed into the deterministic report (branch names, header metadata, table cells) can still gain autolink treatment despite neutralization, leaving the injection surface open in GitHub Step Summaries. Neither headerEscaper nor proseEscaper currently escapes &.
Disclosed in the review of #318 (.uf/dewey/learnings/input-validation-20261102T232636-jay-flowers.md); the renderer gap predates that PR.
Suggested fix (choke point)
In the escaper paths feeding neutralizeAutolinks:
escape & outside code spans — a backslash-escaped \& cannot open an entity reference, and entities are never interpreted inside code spans (so a naive &-escape there would display the backslash), or
defang &# and the named entities that decode to trigger characters alongside the literal triggers.
Test expectations
Byte-level negative fixtures pinning each entity encoding of each trigger character (www., user@, ://, . variants) so no encoder round-trip reopens the surface.
Constraints
Production code change — requires a spec workflow (OpenSpec change) per AGENTS.md Spec-First Development.
Deterministic-rendering contracts (specs/040 contracts/markdown-report.md) must stay intact: escaping changes must not alter rendered output for benign inputs.
Activity
openspec: propose markdown-autolink-entity-bypass