Commit 03da204
committed
fix(core): block creation of sensitive URI attributes from ICU messages
Translators are not allowed to write HTML which creates URI attributes. I opted to ban any values going into an attribute at all, to prevent even links to malicious content, rather than just sanitizing URIs.
I also converted this blocklist into an allowlist. Now, we only allowing setting known attributes (while sanitizing URI attributes). This significantly reduces risk of missing a vulnerable attribute and does not require an exhaustive list of all potential attributes.
BREAKING CHANGE: Angular now only applies known attributes from HTML in translated ICU content. Unknown attributes are dropped and not rendered.1 parent 5ac1c02 commit 03da204
3 files changed
Lines changed: 75 additions & 10 deletions
File tree
- packages/core
- src/render3/i18n
- test
- acceptance
- render3/i18n
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
811 | | - | |
812 | 811 | | |
813 | 812 | | |
814 | 813 | | |
| |||
831 | 830 | | |
832 | 831 | | |
833 | 832 | | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
834 | 848 | | |
835 | | - | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
836 | 856 | | |
837 | 857 | | |
838 | 858 | | |
| |||
945 | 965 | | |
946 | 966 | | |
947 | 967 | | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
954 | 975 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3434 | 3434 | | |
3435 | 3435 | | |
3436 | 3436 | | |
3437 | | - | |
| 3437 | + | |
3438 | 3438 | | |
3439 | 3439 | | |
3440 | 3440 | | |
| |||
3453 | 3453 | | |
3454 | 3454 | | |
3455 | 3455 | | |
3456 | | - | |
| 3456 | + | |
3457 | 3457 | | |
3458 | 3458 | | |
3459 | 3459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
300 | 344 | | |
301 | 345 | | |
302 | 346 | | |
| |||
0 commit comments