Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

fix(security): prevent XSS via script breakout in GraphDiffHtmlExporter - #121

Merged
sauravbhattacharya001 merged 1 commit into
masterfrom
fix/xss-script-breakout-diff-exporter
Mar 28, 2026
Merged

sauravbhattacharya001 merged 1 commit into
masterfrom
fix/xss-script-breakout-diff-exporter

Conversation

@sauravbhattacharya001

Copy link
Copy Markdown
Owner

Problem

\GraphDiffHtmlExporter.escapeJs()\ did not escape <\ and >\ characters. A malicious node ID like </script><script>alert(1)</script>\ could break out of the inline <script>\ block and inject arbitrary HTML/JS (CWE-79).

Root Cause

The \InteractiveHtmlExporter\ already had this fix (escaping </>\ to \\x3c/\\x3e), but the same pattern was not applied to the diff exporter's \�scapeJs()\ method.

Fix

Added \\x3c\ and \\x3e\ hex escapes for <\ and >\ to \GraphDiffHtmlExporter.escapeJs(), matching the existing pattern in \InteractiveHtmlExporter.

GraphDiffHtmlExporter.escapeJs() did not escape < and > characters,
allowing a malicious node ID containing '</script>' to break out of
the inline <script> block and inject arbitrary HTML/JS (CWE-79).

The InteractiveHtmlExporter already had this fix (escaping to \x3c/\x3e)
but the diff exporter was missed.

Added \x3c and \x3e hex escapes for < and > to match the pattern
used in InteractiveHtmlExporter.escapeJs().
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added visualization Graph visualization and UI size/s labels Mar 25, 2026
@sauravbhattacharya001
sauravbhattacharya001 merged commit 01fbe30 into master Mar 28, 2026
4 of 8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/s visualization Graph visualization and UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant