commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jukefox (JIRA)" <>
Subject [jira] [Commented] (LANG-572) [XSS] StringEscapeUtils.escapeHtml() must escape ' chars to &#39;
Date Tue, 23 Apr 2013 16:25:15 GMT


jukefox commented on LANG-572:

Could you please describe why you conclude that the request is out of scope for {{escapeHtml}}?
I cannot find any explanation in this ticket.
>From my point of view it is essential to escape single quote characters not only because
of possible XSS as described above but also to prevent syntactically illegal code when putting
variable data as part of a value to an attribute when relying on {{escapeHtml}}.


> [XSS] StringEscapeUtils.escapeHtml() must escape ' chars to &#39; 
> ------------------------------------------------------------------
>                 Key: LANG-572
>                 URL:
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 2.4
>         Environment: Operating System: All
> Platform: All 
>            Reporter: Keisuke Kato
>            Priority: Minor
> If developers putting untrusted data into attribute values using the single quote character
' and StringEscapeUtils.escapeHtml() like:
> <input type='text' name='input' value=*'<%=StringEscapeUtils.escapeHtml(request.getParameter("input"))%>'*>
> Then, the attacker is able to break out of the HTML attribute context like:
> hxxp://*' onfocus='alert(document.cookie);' id='*
> <input type='text' name='input' value='*'onfocus='alert(document.cookie);'id='*'>
> I think [LANG\-122|] is not truly fixed
from this aspect (XSS).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message