-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] caja-html-sanitizer: avoid catastrophic backtracking in lexCss
The caja-html-sanitizer uses a complex regular expression to tokenize CSS styles before parsing and sanitizing them. That regular expression contains a sub-expression that allows alternative interpretations of arbitrarily long input sequences and therefore might cause extensive backtracking (see googlearchive/caja#2037 ). To prevent this, the corresponding sub-expression has been rewritten to simulate an atomic group (or possessive quantifier) as described in https://instanceof.me/post/52245507631/regex-emulate-atomic-grouping-with-lookahead. Change-Id: Ia9e8e038d8b4cf5a7cf2684a14877fc08bf1be80 BCP: 002075129500001766652020
- Loading branch information
1 parent
bf20511
commit c00ebef
Showing
2 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters