You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2009/12/20 20:56:18 UTC

[jira] Issue Comment Edited: (LANG-572) [XSS] StringEscapeUtils.escapeHtml() must escape ' chars to '

    [ https://issues.apache.org/jira/browse/LANG-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793026#action_12793026 ] 

Sebb edited comment on LANG-572 at 12/20/09 7:54 PM:
-----------------------------------------------------

Agree that it is out of scope for escapeHtml.

What's being requested here is a means of sanitising input data, which is not at all the same. 
For example, there is no need to change "&" or ">" in order to make the input safe.
Indeed, that may have unwanted side effects.

      was (Author: sebb@apache.org):
    Agree that it is out of scope for escapeHtml.

What's being requested here is a means of sanitising input data, which not at all the same. 
For example, there is no need to change "&" or ">" in order to make the input safe.
Indeed, that may have unwanted side effects.
  
> [XSS] StringEscapeUtils.escapeHtml() must escape ' chars to &#39; 
> ------------------------------------------------------------------
>
>                 Key: LANG-572
>                 URL: https://issues.apache.org/jira/browse/LANG-572
>             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://example.org/?input=*' onfocus='alert(document.cookie);' id='*
> <input type='text' name='input' value='*'onfocus='alert(document.cookie);'id='*'>
> I think [LANG\-122|https://issues.apache.org/jira/browse/LANG-122] is not truly fixed from this aspect (XSS).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.