sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Windszus (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SLING-7658) XSSApi.encodeForHtml doesn't leave unicode character escapes untouched
Date Sat, 02 Jun 2018 10:49:00 GMT

    [ https://issues.apache.org/jira/browse/SLING-7658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16498990#comment-16498990
] 

Konrad Windszus edited comment on SLING-7658 at 6/2/18 10:48 AM:
-----------------------------------------------------------------

Actually even {{XSSFilter.filter(...)}} doesn't leave unicode escape sequences untouched but
rather unescapes those. Please see the attached failing test  [^SLING-7658-v02.patch]. This
is an issue for HTML which is not using UTF-8! As this issue is no longer related to this
original issue I created SLING-7703 for the new issue and close this one as Won't fix.


was (Author: kwin):
Actually even {{XSSFilter.filter(...)}} doesn't leave unicode escape sequences untouched but
rather unescapes those. Please see the attached failing test  [^SLING-7658-v02.patch]. This
is an issue for HTML which is not using UTF-8!

> XSSApi.encodeForHtml doesn't leave unicode character escapes untouched
> ----------------------------------------------------------------------
>
>                 Key: SLING-7658
>                 URL: https://issues.apache.org/jira/browse/SLING-7658
>             Project: Sling
>          Issue Type: Bug
>          Components: XSS Protection API
>    Affects Versions: XSS Protection API 2.1.0
>            Reporter: Konrad Windszus
>            Priority: Major
>         Attachments: SLING-7658-v01.patch, SLING-7658-v02.patch
>
>
> Whenever {{encodeForHtml}} is called with a string containing a unicode character escapes
(https://www.w3.org/International/questions/qa-escapes#answer), the {{&}} gets escaped
again. I.e. {{&#9989;}} becomes {{&amp;#9989;}}.
> Compare with the discussion at https://www.mail-archive.com/dev@sling.apache.org/msg76863.html.
> Attached is a patch with a failing test.
> Another use case for using unicode character escapes is the soft hyphen (https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens#Suggesting_line_break_opportunities).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message