Skip to content

fix(ng-dev): prevent arbitrary code execution via HTML injection#3739

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
josephperrott:fix-release-notes-injection
Jun 5, 2026
Merged

fix(ng-dev): prevent arbitrary code execution via HTML injection#3739
alan-agius4 merged 1 commit into
angular:mainfrom
josephperrott:fix-release-notes-injection

Conversation

@josephperrott
Copy link
Copy Markdown
Member

This PR mitigates a Cross-Site Scripting (XSS) vulnerability where an attacker could inject arbitrary HTML/JavaScript into the release notes via a malicious commit message.

We implemented a robust HTML escaping mechanism for commit fields in ng-dev/release/notes/context.ts using named HTML entities to ensure they are safely rendered by the EJS templates.

@josephperrott josephperrott requested a review from alan-agius4 June 5, 2026 00:09
@josephperrott josephperrott added the action: merge The PR is ready for merge by the caretaker label Jun 5, 2026
@google-cla

This comment was marked as outdated.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds HTML escaping to release notes fields, including commit types, group names, descriptions, breaking changes, and deprecations, to ensure safe rendering. The review feedback suggests improving the robustness of the escapeHtml function by handling nullish values, which prevents potential runtime crashes if commit fields are malformed or missing.

Comment thread ng-dev/release/notes/context.ts
@josephperrott josephperrott force-pushed the fix-release-notes-injection branch from 1cb4a8f to fcc0132 Compare June 5, 2026 00:12
@alan-agius4 alan-agius4 merged commit 7ba841c into angular:main Jun 5, 2026
16 checks passed
@alan-agius4
Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

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

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants