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

   When `weblogAdminsUntrusted=true`, `HTMLSanitizer` cleans what weblog users 
write each time it's shown. On 6.1.x it's still the old regex-based sanitizer, 
which master replaces with jsoup in #356. Timing it on crafted markup:
   
   - An 80,000-character `style` attribute took 43 seconds.
   - An unclosed tag with 20,000 spaces took 2 seconds, and an unclosed 
`url('''…` took 1.4 seconds.
   - Output is built by string concatenation, so 640,000 characters of ordinary 
tags took 4 seconds.
   
   This is the smallest fix for 6.1.8: each sanitize call gets a one-second 
limit, checked while its expressions read the markup and once per tag, like the 
banned-words limit in #358. Markup that hits the limit is escaped in full and a 
warning is logged, so a slow post shows as text instead of holding the request. 
Ordinary markup is unaffected; a 12,000-character post still takes about 13 ms.
   
   `HTMLSanitizerTimeLimitTest` timed out before the change and passes after 
it. The full app suite passes (562 tests, 1 skipped). I also timed the comment 
HTML subset (`Utilities.transformToHTMLSubset`) on similar input, and it stays 
linear, so it isn't changed.
   


-- 
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