Skip to content

fix(bundler-plugins): Escape JSON in generated injection code - #25265

Merged
msonnb merged 1 commit into
developfrom
ms/escape-bundler-injection-json
Oct 12, 2026
Merged

msonnb merged 1 commit into
developfrom
ms/escape-bundler-injection-json

Conversation

@msonnb

@msonnb msonnb commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

JSON.stringify leaves HTML script delimiters intact, allowing attacker-controlled injected values to break out if a consumer inlines the generated bundle into HTML. Escape < in metadata, release names, and build information so HTML parsing cannot reinterpret those values, while preserving their exact JavaScript runtime values.

Fixes code-scanning alert #467.

@msonnb

msonnb commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a92a768. Configure here.

@msonnb
msonnb marked this pull request as ready for review October 12, 2026 13:04
@msonnb
msonnb requested review from a team, chargome, logaretm and stephanie-anderson and removed request for a team October 12, 2026 13:04

@chargome chargome left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice

@msonnb
msonnb merged commit 87bdc84 into develop Oct 12, 2026
504 of 506 checks passed
@msonnb
msonnb deleted the ms/escape-bundler-injection-json branch October 12, 2026 14:32
msonnb pushed a commit that referenced this pull request Oct 12, 2026
…5298)

Backport of: #25265

<!-- junior-request-attribution:start -->
via Junior system actor `junior`.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!--
junior-conversation-id:agent-dispatch%3Adispatch_660e6b62c4d26a5ea0c41642e0a94440
-->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_660e6b62c4d26a5ea0c41642e0a94440)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_660e6b62c4d26a5ea0c41642e0a94440/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
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