angular/packages/compiler-cli
Alan Agius 7c42e2ebeb fix(compiler): prevent XSS via SVG animation attributeName and MathML/SVG URLs
This commit implements a security fix to prevent XSS vulnerabilities where SVG animation elements (`<animate>`, `<set>`, etc.) could be used to modify the `href` or `xlink:href` attributes of other elements to `javascript:` URLs.

The fix introduces a runtime validation step:
- A new [ɵɵValidateAttribute](cci:1://file:///usr/local/google/home/alanagius/git/angular/packages/core/src/sanitization/sanitization.ts:276:0-288:1) instruction is used when `attributeName` is bound on SVG animation elements.
- If executed, a `RuntimeError` is thrown, preventing the binding.
- The compiler now identifies `attributeName` on SVG animation elements as security-sensitive and injects this validation.

Additionally, the DOM security schema has been updated to include a comprehensive list of MathML and SVG elements that accept `href` or `xlink:href` attributes, ensuring they are correctly treated as `SecurityContext.URL` and sanitized. This prevents malicious URLs from being bound to these attributes.

http://b/463880509
2025-12-01 10:28:38 +01:00
..
integrationtest Revert "refactor(core): remove unused injection props (#59209)" (#59386) 2025-01-06 21:35:58 +00:00
linker refactor(compiler-cli): convert scripts within packages/compiler-cli to relative imports (#60655) 2025-04-01 11:59:14 +00:00
ngcc build: migrate compiler-cli/src/ngtsc/docs to ts_project (#61237) 2025-05-09 16:01:49 +00:00
private build: properly compile tests in core with Angular compiler (#60268) 2025-03-07 11:00:48 -08:00
src refactor(compiler-cli): remove hardcoded config for unused standalone imports rule enablement (#61622) 2025-05-26 09:20:27 +00:00
test fix(compiler): prevent XSS via SVG animation attributeName and MathML/SVG URLs 2025-12-01 10:28:38 +01:00
BUILD.bazel build: exclude esbuild metadata files from distributable packages (#61636) 2025-05-26 08:57:43 +00:00
esbuild.config.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
index.ts build: migrate compiler-cli/src/ngtsc/docs to ts_project (#61237) 2025-05-09 16:01:49 +00:00
package.json build: support new ng_project rule (#61336) 2025-05-14 08:31:33 -07:00
tsconfig-test.json build: prepare for compiler-cli to be using ts_project (#61237) 2025-05-09 16:01:49 +00:00
tsconfig.json build: prepare for compiler-cli to be using ts_project (#61237) 2025-05-09 16:01:49 +00:00