mraible opened a new pull request, #357:
URL: https://github.com/apache/roller/pull/357

   Banned words rules are regular expressions: rules that start with `(` 
directly, and every other rule as `\b(rule)\b`. A weblog's own banned words and 
the site's list are compiled as written, so a rule like `((x+)+)+y` held a 
comment post or a referrer check for as long as it backtracked. CodeQL flags 
this as regex injection (alert 95). A comment post checks the commenter's name, 
e-mail, URL and text.
   
   - Each value is now matched through a `CharSequence` that stops the match 
once 1 second has passed.
   - The value then counts as a match, so a comment that sets off such a rule 
is caught as spam, and the rule is logged so it can be simplified.
   - Ordinary checks take a few milliseconds; 40,000 characters against the 
bundled list take about 24 ms.
   
   The new BannedwordslistTest case uses `((x+)+)+y` as a regex rule and as a 
word rule. It timed out before the fix on both lines and passes after.
   
   The full unit suite passes (762 tests). The 6.1.x change is a separate PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to