exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Apache Struts 2 Cross Site Scripting

Apache Struts 2 Cross Site Scripting
Posted May 11, 2011
Authored by Dr. Marian Ventuneac

Apache Struts 2 framework before version 2.2.3 is vulnerable to reflected cross site scripting attacks when default XWork generated error messages are displayed.

tags | exploit, xss
advisories | CVE-2011-1772
SHA-256 | 56db3b61b0797b0f8126cafa87b59fc81640d7a0bf85b1073ed4eef9c6cfcb01

Apache Struts 2 Cross Site Scripting

Change Mirror Download


Security Advisory: MVSA-11-006

CVE: CVE-2011-1772

Vendor: Apache Software Foundation

Product: Struts 2 Framework

Vulnerabilities: Multiple Reflected XSS in XWork error pages

Risk: High

Attack Vector: From Remote

Authentication: Not Required

References:
- http://secureappdev.blogspot.com/2011/05/Struts_2_XWork_WebWork_XSS_in_error_pages.html
- https://issues.apache.org/jira/browse/WW-3579
- http://struts.apache.org/2.x/doc/s2-006.html


Description

Apache Struts 2 framework before version 2.2.3 is vulnerable to reflected Cross-Site Scripting (XSS) attacks when default XWork generated error messages are displayed. User provided data is not properly escaped before being included in XWork generated errors, thus allowing successful reflected XSS attacks as described below.

1. XSS payload injected in the name of the requested Struts actions (Dynamic Method Invocation not enabled)

http://test.app.net/home<img>.action

2. Reflected XSS vulnerabilities in <s:submit> tag using bash syntax with Dynamic Method Invocation (DMI) enabled

a. Reflected XSS via action attribute of <s:submit> tag

http://test.app.net/home.action?user=&password=&action!login<script>alert(document.cookie)
</script>:cantLogin=some_value

b. Reflected XSS via method attribute of <s:submit> tag

http://test.app.net/home.action?user=&password=&action!login:cantLogin<script>alert(document.cookie
</script>=some_value


Affected Versions

All releases of Apache Struts 2 framework prior to 2.2.3 were found vulnerable to the above attacks.

Other open source and commercial products using XWork framework could be vulnerable to similar attacks.

WebWork framework released by OpenSymphony (http://opensymphony.org) was confirmed as vulnerable to the attacks described in this advisory.

Mitigation

It is recommended to upgrade to Apache Struts 2.2.3 released on 5th of May 2011, or to the latest available version.

Alternatively, it is recommended to implement a custom error page (eg. error_page.jsp) which either uses proper output encoding to display XWork generated errors or displays a generic error message. An example of required configuration in struts.xml file is shown below:


<global-results>
<result name="error">/error_page.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>


Disclosure Timeline

2011, February 18: Vulnerabilities discovered and documented
2011, February 18: First notification sent to Apache
2011, February 21: Second notification sent to Apache
2011, February 22: WW-3579 JIRA ticket created
2011, February 22: Apache acknowledges receiving the report
2011, February 22: Apache acknowledges the vulnerabilities
2011, March 27: Apache Struts 2.2.2 test build released
2011, April 8: Apache Struts 2.2.3 test build released
2011, May 5: Apache Struts 2.2.3 general availability build released
2011, May 11: MVSA-11-006 advisory published.

Credits

Dr. Marian Ventuneac
http://www.ventuneac.net
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close