Skip to content

fix: harden html attribute escaping#140

Merged
cssbruno merged 3 commits into
mainfrom
fix/codeql-attr-quoting
Jun 9, 2026
Merged

fix: harden html attribute escaping#140
cssbruno merged 3 commits into
mainfrom
fix/codeql-attr-quoting

Conversation

@cssbruno

@cssbruno cssbruno commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Use the HTML-template escaper for generated HTML attribute values.
  • Reject unsafe generated attribute names before rendering an attribute.
  • Add regression coverage for JSON attribute values containing quotes, HTML markup, and ampersands.

This addresses the CodeQL alert on runtime/html/html.go for potentially unsafe quoting in generated HTML attributes.

Verification

  • I ran the relevant tests, lint, and build commands.
  • I ran scripts/test-go-modules.sh when Go code or compiler behavior changed.
  • I ran go build ./cmd/gowdk when CLI, compiler, runtime, addon, or release behavior changed.
  • I ran node --check editors/vscode/extension.js when editor files changed.
  • I updated docs for behavior, setup, or architecture changes.
  • I added or updated tests for changed behavior.

Additional validation:

  • go test ./runtime/html
  • git diff --check
  • go test ./...

LLM Assistance

  • LLM session summary: Codex fixed the CodeQL HTML attribute quoting finding with a scoped runtime helper change and regression tests.
  • Human-reviewed assumptions: Pending maintainer review before merge.
  • Follow-up work: Re-run GitHub CodeQL on the PR to confirm the alert closes in GitHub Security.

Comment thread runtime/html/html.go Fixed
@cssbruno cssbruno force-pushed the fix/codeql-attr-quoting branch from 20cc2c5 to cd95c1c Compare June 9, 2026 17:37
Comment thread runtime/html/html.go Fixed
@cssbruno cssbruno force-pushed the fix/codeql-attr-quoting branch from cd95c1c to 91e7960 Compare June 9, 2026 18:45
@cssbruno cssbruno merged commit e1c55d7 into main Jun 9, 2026
5 checks passed
@cssbruno cssbruno deleted the fix/codeql-attr-quoting branch June 9, 2026 18:52
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.

2 participants