Multiple denylist patterns are not applied to CDATA validation #4319
Labels
Bug
Something isn't working
Changelogged
Whether the issue/PR has been added to release notes.
CSS
P2
Low priority
Validation
WS:Core
Work stream for Plugin core
Milestone
Bug Description
It turns out that CDATA can have multiple
blacklisted_cdata_regex
constraints, for example:However, the Python spec parser is only capturing one:
amp-wp/includes/sanitizers/class-amp-allowed-tags-generated.php
Lines 15398 to 15403 in b059e63
And the sanitizer is only expecting one:
amp-wp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php
Lines 902 to 918 in b059e63
This means at present CSS selectors that contain
i-amphtml-*
will not get caught by the sanitizer, even though they are invalid. Related: #771.We need to fix how the spec is parsed for
blacklisted_cdata_regex
. We should also check to see if this same thing is happening for other properties. At first I thoughtblacklisted_value_regex
would be a candidate, but it seems to already be changed to concatenate all denied patterns into a single regex.Expected Behaviour
Multiple
blacklisted_cdata_regex
constraints should be captured and applied during sanitization/validation.Steps to reproduce
Screenshots
Additional context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: