Skip to content

Fix indexer demo DOM XSS - #6

Merged
kalepail merged 1 commit into
mainfrom
fix/indexer-demo-xss
Aug 19, 2026
Merged

Fix indexer demo DOM XSS#6
kalepail merged 1 commit into
mainfrom
fix/indexer-demo-xss

Conversation

@kalepail

Copy link
Copy Markdown
Contributor

Summary

  • Encode untrusted indexer metadata before HTML rendering.
  • Protect text and quoted attribute contexts.
  • Add a Content Security Policy for inline script protection.
  • Add regression tests and CI coverage for the indexer demo.

Verification

  • pnpm --filter indexer-demo test
  • pnpm --filter indexer-demo build
  • pnpm test --run
  • Live Chromium replay created zero injected elements.
  • All seven exploit markers remained zero.

Copilot AI balanced review requested due to automatic review settings August 19, 2026 16:08
@kalepail
kalepail merged commit 3f29ac1 into main Aug 19, 2026
7 checks passed
@kalepail
kalepail deleted the fix/indexer-demo-xss branch August 19, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens the indexer demo against DOM XSS from untrusted metadata.

Changes:

  • Escapes dynamic HTML text and attribute values.
  • Adds CSP protection and escape regression tests.
  • Adds demo test/build coverage to CI.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
indexer/demo/src/main.ts Escapes indexer metadata before rendering.
indexer/demo/src/html.ts Adds HTML escaping utility.
indexer/demo/src/html.test.ts Tests escaping behavior and payloads.
indexer/demo/index.html Adds Content Security Policy.
indexer/demo/package.json Adds Vitest and test script.
pnpm-lock.yaml Locks the Vitest dependency.
.github/workflows/ci.yml Runs indexer demo tests and build.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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