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

   `#showMetaDescription` (in `WEB-INF/velocity/weblog.vm`) and the Gaurav 
theme's `std_head.vm` write the weblog's "about" text and an entry's search 
description straight into `<meta name="description" content="...">`.
   
   - With trusted weblog admins (the default), those values are output as 
stored, so a description containing a quote, such as `Matt's "weblog"`, ends 
the attribute early and leaves the rest of the text as stray attributes.
   - With `weblogAdminsUntrusted=true`, the wrappers already run them through 
`HTMLSanitizer`, which encodes the quote, so escaping again naively would show 
`&quot;` to search engines.
   
   This is hardening rather than a vulnerability fix: in trusted mode authors 
can already post HTML in entries, and in untrusted mode the sanitizer already 
blocks the breakout. It does mean a report of "author can break out of the meta 
tag" no longer applies in either mode.
   
   Both templates now use 
`$utils.escapeHTML($utils.unescapeHTML($utils.removeHTML(...)))`. Tags are 
removed, entities decoded, then the result is encoded once.
   
   `MetaDescriptionEscapingTest` renders both templates, on weblog and 
permalink pages, with:
   - a stored quote-breakout string
   - the same string already encoded by the sanitizer
   - `&` and quotes together
   - a value with tags
   
   It fails on the old templates.


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