commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Reek (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LANG-871) [XSS] Possible attacks through StringEscapeUtils.escapeEcmaScript?
Date Thu, 14 Feb 2013 12:30:13 GMT
Andy Reek created LANG-871:
------------------------------

             Summary: [XSS] Possible attacks through StringEscapeUtils.escapeEcmaScript?
                 Key: LANG-871
                 URL: https://issues.apache.org/jira/browse/LANG-871
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.*
    Affects Versions: 3.1
            Reporter: Andy Reek


org.apache.commons.lang3.StringEscapeUtils.escapeEcmaScript does the escape via a prefixed
'\' on all characters which must be escaped. I am not sure if this is really secure, if am
looking at the comments on https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#RULE_.233_-_JavaScript_Escape_Before_Inserting_Untrusted_Data_into_JavaScript_Data_Values.
They say it is possible to do an attack by escape the escape. I tested this with the string
'\"' and the output was '\\\"'. Is this really ecma-/java-script secure? Or is it better to
use the the implementation used by OWASP?

--
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: http://www.atlassian.com/software/jira

Mime
View raw message