Skip to content

gh-159640: Escape profile data embedded in flamegraph HTML - #159646

Open
zolaski333 wants to merge 1 commit into
python:mainfrom
zolaski333:codex/gh-159640-flamegraph-html-escape
Open

zolaski333 wants to merge 1 commit into
python:mainfrom
zolaski333:codex/gh-159640-flamegraph-html-escape

Conversation

@zolaski333

@zolaski333 zolaski333 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Escape < in serialized profile data before embedding it in flamegraph HTML. This prevents profile strings from closing the script element or starting an HTML comment, while preserving the decoded values.

Add regression coverage for both JSON serialization paths, including mixed-case script tags, Unicode characters, and literal escape sequences.

Validation on Windows:

  • All 115 collector tests pass in standard and free-threaded builds.
  • Debug tests pass with reference leak checking (-R 3:3).
  • patchcheck and git diff --check pass.

Fixes #159640.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sampling profiler flamegraph HTML does not escape </script> in embedded profile data

1 participant