fix(core): allow css custom variables/properties in the style sanitizer (#33841)
This change enables "var(--my-var)" to pass through the style sanitizer. After consulation with our security team, allowing these doesn't create new attack vectors, so the sanitizer doesn't need to strip them. Fixes parts of #23485 related to the sanitizer, other use cases discussed there related to binding have been addressed via other changes to the class and style handling in the runtime. Closes #23485 PR Close #33841
This commit is contained in:

committed by
Alex Rickabaugh

parent
4e0eb3627d
commit
61cc7a3437
@ -29,7 +29,7 @@ const VALUES = '[-,."\'%_!# a-zA-Z0-9]+';
|
||||
const TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|Z|3d)?';
|
||||
const COLOR_FNS = '(?:rgb|hsl)a?';
|
||||
const GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';
|
||||
const CSS3_FNS = '(?:attr|calc)';
|
||||
const CSS3_FNS = '(?:attr|calc|var)';
|
||||
const FN_ARGS = '\\([-0-9.%, #a-zA-Z]+\\)';
|
||||
const SAFE_STYLE_VALUE = new RegExp(
|
||||
`^(${VALUES}|` +
|
||||
|
Reference in New Issue
Block a user