Commit 8616ba9
fix(core): ensure SVG animation attributeName is checked case-insensitively
Currently, the SVG sanitizer checks a static set of candidate attribute
names (`attributeName` and `attributename`). This approach misses other case
variations (such as `attributenAme` or others), which could potentially
bypass sanitization when binding sensitive attributes like `href` on
`<set>` or `<animate>` elements.
This change retrieves all attribute names of the SVG element, performs a
case-insensitive comparison with `'attributename'`, and sanitizes the value
if a match is found.
(cherry picked from commit 3499a13)1 parent 90e81e4 commit 8616ba9Copy full SHA for 8616ba9
2 files changed
+21-32Lines changed: 21 additions & 32 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- packages/core
- src/sanitization
- test/render3
Expand file treeCollapse file tree
Open diff view settings
Collapse file
packages/core/src/sanitization/sanitization.ts
Copy file name to clipboardExpand all lines: packages/core/src/sanitization/sanitization.ts+5-2Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
277 | 277 | |
278 | 278 | |
279 | 279 | |
280 | | - |
281 | 280 | |
282 | 281 | |
283 | 282 | |
| ||
394 | 393 | |
395 | 394 | |
396 | 395 | |
397 | | - |
| 396 | + |
| 397 | + |
| 398 | + |
| 399 | + |
| 400 | + |
398 | 401 | |
399 | 402 | |
400 | 403 | |
|
Collapse file
packages/core/test/render3/integration_spec.ts
Copy file name to clipboardExpand all lines: packages/core/test/render3/integration_spec.ts+16-30Lines changed: 16 additions & 30 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
662 | 662 | |
663 | 663 | |
664 | 664 | |
665 | | - |
666 | | - |
667 | | - |
668 | | - |
669 | | - |
670 | | - |
671 | | - |
672 | | - |
673 | | - |
674 | | - |
675 | | - |
676 | | - |
677 | | - |
678 | | - |
679 | | - |
680 | | - |
681 | 665 | |
682 | 666 | |
683 | 667 | |
| ||
686 | 670 | |
687 | 671 | |
688 | 672 | |
689 | | - |
690 | | - |
691 | | - |
692 | | - |
693 | | - |
694 | | - |
695 | | - |
696 | | - |
697 | | - |
| 673 | + |
| 674 | + |
| 675 | + |
| 676 | + |
| 677 | + |
| 678 | + |
| 679 | + |
| 680 | + |
| 681 | + |
| 682 | + |
| 683 | + |
| 684 | + |
| 685 | + |
| 686 | + |
| 687 | + |
698 | 688 | |
699 | | - |
700 | | - |
701 | | - |
702 | | - |
703 | | - |
| 689 | + |
704 | 690 | |
705 | 691 | |
706 | 692 | |
|
0 commit comments