angular/packages/compiler-cli/test/ngtsc
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
..
doc_extraction refactor(compiler-cli): Extract type predicates from type guards. (#60934) 2025-04-23 09:56:45 +02:00
attach_source_location_spec.ts build: move private testing helpers outside platform-browser/testing (#61571) 2025-05-21 16:04:42 +00:00
authoring_diagnostics_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
authoring_inputs_spec.ts refactor(compiler-cli): move two-way binding fix behind flag (#59002) 2024-12-05 16:11:02 -08:00
authoring_models_spec.ts refactor(compiler-cli): move two-way binding fix behind flag (#59002) 2024-12-05 16:11:02 -08:00
authoring_outputs_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
authoring_queries_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
BUILD.bazel build: migrate compiler-cli/src/ngtsc to ts_project (#61237) 2025-05-09 16:01:49 +00:00
component_indexing_spec.ts build: move private testing helpers outside platform-browser/testing (#61571) 2025-05-21 16:04:42 +00:00
defer_spec.ts refactor(compiler-cli): convert scripts within packages/compiler-cli to relative imports (#60655) 2025-04-01 11:59:14 +00:00
env.ts refactor(compiler-cli): convert scripts within packages/compiler-cli to relative imports (#60655) 2025-04-01 11:59:14 +00:00
extended_template_diagnostics_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
hmr_spec.ts fix(compiler): avoid conflicts between HMR code and local symbols (#61550) 2025-05-21 12:25:27 +00:00
host_directives_spec.ts refactor(compiler): update compliance tests. (#58238) 2024-10-24 12:44:12 -07:00
imports_spec.ts fix(compiler-cli): support relative imports to symbols outside rootDir (#60555) 2025-03-26 20:45:56 -07:00
incremental_error_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
incremental_semantic_changes_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
incremental_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
incremental_typecheck_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
local_compilation_spec.ts refactor(compiler): update compliance tests. (#58238) 2024-10-24 12:44:12 -07:00
ls_typecheck_helpers_spec.ts refactor(compiler-cli): convert scripts within packages/compiler-cli to relative imports (#60655) 2025-04-01 11:59:14 +00:00
monorepo_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
ngtsc_spec.ts fix(compiler): prevent XSS via SVG animation attributeName and MathML/SVG URLs 2025-12-01 10:28:38 +01:00
scope_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
sourcemap_utils.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
standalone_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
template_mapping_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
template_typecheck_spec.ts feat(compiler): support untagged template literals in expressions (#59230) 2025-01-21 12:04:53 -08:00
util.ts refactor(compiler-cli): convert scripts within packages/compiler-cli to relative imports (#60655) 2025-04-01 11:59:14 +00:00
xi18n_spec.ts refactor(compiler-cli): convert scripts within packages/compiler-cli to relative imports (#60655) 2025-04-01 11:59:14 +00:00