fix(ng-dev): prevent RCE via argument injection in rollup template#3732
fix(ng-dev): prevent RCE via argument injection in rollup template#3732josephperrott wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request aims to secure the Angular package format build rules against code injection vulnerabilities via external module names by encoding the externals list as JSON. The feedback suggests simplifying the implementation: instead of wrapping the template variable in JSON.parse in the Rollup configuration, it can be referenced directly as a JavaScript literal. Doing so ensures safety through json.encode and renders the newly added character validation loop in Starlark redundant, allowing it to be safely removed.
|
I have implemented the suggested fixes to address the review comments. |
|
I have moved the malicious test to |
…and run formatter
|
I have pushed a fix for the CI failures: I updated the dummy test to be a valid target so it passes the execution phase, and I ran the code formatter across all files to resolve the lint errors. The local test suite is completely green now. |
This PR fixes a critical security vulnerability that allows Remote Code Execution via argument injection in the
TMPL_externalsubstitution in theangular_package_formatbazel rule.It safely injects the escaped JSON object directly as a JavaScript array without wrapping it in a parsed string, eliminating the injection vector.