Skip to content

Fix code-scanning security alerts - #30

Merged
jrepp merged 1 commit into
mainfrom
agent/fix-code-scanning-alerts
Aug 11, 2026
Merged

Fix code-scanning security alerts#30
jrepp merged 1 commit into
mainfrom
agent/fix-code-scanning-alerts

Conversation

@jrepp

@jrepp jrepp commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • restrict the CI workflow token to read-only repository contents
  • replace batch-demo HTML string rendering with safe DOM construction
  • render user-controlled addresses, zone IDs, formatted output, and diagnostics with textContent
  • harden the equivalent single-address diagnostic path

Root cause

The CI workflow inherited the repository's default GITHUB_TOKEN permissions instead of declaring least privilege. The browser demo also concatenated textarea input and parser-derived values into an HTML string before assigning it to innerHTML, allowing DOM text to be reinterpreted as markup.

Impact

This addresses the five missing-workflow-permissions findings and the high-severity js/xss-through-dom finding currently reported by CodeQL. The demo preserves its existing result layout and expandable diagnostics while treating all dynamic values as text.

Validation

  • actionlint .github/workflows/ci.yml
  • inline demo script syntax check with Node.js
  • npm run lint
  • dependency security regression tests
  • Node.js, WASM, synchronous API, error, and diagnostic test suites
  • build-output validation

Validated with the pinned Node.js 26.7.0 and npm 12.0.2 toolchain.

@jrepp
jrepp marked this pull request as ready for review August 11, 2026 16:46
@jrepp
jrepp merged commit f837383 into main Aug 11, 2026
36 checks passed
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.

1 participant