Skip to content

Security: croaky/highlight

Security

SECURITY.md

Security

Tier: single-user local tool and rendering library.

highlight is a Go standard-library syntax highlighter that tokenizes source code and emits HTML-escaped <span> elements (Code and Diff). It makes no network requests, filesystem writes, or subprocess calls.

Adversaries

  1. Untrusted source text or diffs passed into Code or Diff attempting HTML/XSS injection or quadratic CPU and memory exhaustion during scanning.
  2. A compromised dependency in tools.mod.

Accepted risks

Resolve scanner findings in these areas as accepted_risk instead of adding defensive code:

  • Caller-controlled input size: highlight keeps scanners linear with bounded carried state, while the calling application enforces overall input byte limits.
  • Host application CSS and CSP: The host application owns its stylesheet and Content-Security-Policy headers. highlight emits only fixed hl-* class names and HTML-escaped text.
  • Local process compromise: An attacker who controls the calling Go process already owns its memory and output.

There aren't any published security advisories