Skip to content

chore(security): add output-escaping/XSS regression gate (#343) - #359

Merged
krisarmstrong merged 1 commit into
mainfrom
feat/343-escaping-gate
May 29, 2026
Merged

chore(security): add output-escaping/XSS regression gate (#343)#359
krisarmstrong merged 1 commit into
mainfrom
feat/343-escaping-gate

Conversation

@krisarmstrong

Copy link
Copy Markdown
Collaborator

Audit (2026-05-28): classified all 93 fmt.Fprintf(w, ...) sites.
90 are CLI help display (internal/help, ANSI → stdout); 3 are literal
SSE comment lines in internal/api (": heartbeat\n\n" etc., no format
verbs). Zero sites render user data as HTML. No code fix needed.

Adds scripts/check-output-escaping.sh + CI wiring to prevent
regressions:

  • fails if raw innerHTML injection appears in ui/src app code
  • fails if a value-interpolating fmt.Fprintf(w, "...%s...") is added
    in internal/api (HTTP responses must use the JSON encoder or
    html/template; literal SSE comments don't match)

Modeled on the existing scripts/check-token-discipline.sh gate.
Currently passes clean.

Closes #343.

Audit (2026-05-28): classified all 93 fmt.Fprintf(w, ...) sites.
90 are CLI help display (internal/help, ANSI → stdout); 3 are literal
SSE comment lines in internal/api (": heartbeat\n\n" etc., no format
verbs). Zero sites render user data as HTML. No code fix needed.

Adds scripts/check-output-escaping.sh + CI wiring to prevent
regressions:
- fails if raw innerHTML injection appears in ui/src app code
- fails if a value-interpolating fmt.Fprintf(w, "...%s...") is added
  in internal/api (HTTP responses must use the JSON encoder or
  html/template; literal SSE comments don't match)

Modeled on the existing scripts/check-token-discipline.sh gate.
Currently passes clean.

Closes #343.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions github-actions Bot added the ci label May 29, 2026
@krisarmstrong
krisarmstrong enabled auto-merge (squash) May 29, 2026 00:36
@github-actions

Copy link
Copy Markdown
Contributor

License Compliance Report

All dependencies pass license compliance checks

Go Dependencies

  • Unknown: 31 package(s)
  • MIT: 26 package(s)
  • BSD-3-Clause: 16 package(s)
  • Apache-2.0: 11 package(s)
  • BSD-2-Clause: 1 package(s)

npm Dependencies

See full report in workflow artifacts

Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0
Forbidden: GPL, AGPL, SSPL (strong copyleft)

@krisarmstrong
krisarmstrong merged commit fb5345e into main May 29, 2026
28 checks passed
@krisarmstrong
krisarmstrong deleted the feat/343-escaping-gate branch May 29, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY] Audit 93 fmt.Fprintf(w, …) sites (most are SSE wire format)

1 participant