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

Struts2 2.3.15 Open Redirect

Struts2 2.3.15 Open Redirect
Posted Aug 13, 2013
Authored by Takeshi Terada

Struts2 suffers from an open redirection vulnerability. Versions 2.0.0 through 2.3.15 are affected.

tags | exploit
advisories | CVE-2013-2248
SHA-256 | 8e587d23a0336a32690f4388769b814ac267b69bb258b88ffb28d65bb7e874dc

Struts2 2.3.15 Open Redirect

Change Mirror Download
CVE Number:         CVE-2013-2248
Title: Struts2 Prefixed Parameters Open Redirect Vulnerability
Affected Software: Apache Struts v2.0.0 - 2.3.15
Credit: Takeshi Terada of Mitsui Bussan Secure Directions, Inc.
Issue Status: v2.3.15.1 was released which fixes this vulnerability
Issue ID by Vender: S2-017

Overview:
Struts2 is an open-source web application framework for Java.
Struts2 (v2.0.0 - 2.3.15) is vulnerable to open redirect (and possibly
HTTP response header injection). This is caused by insecure design of
prefixed parameters (redirect: and redirectAction:)
in DefaultActionMapper class of Struts2.

Details:
Struts2's ActionMapper is a mechanism for mapping between incoming HTTP
request and action to be executed on the server. DefaultActionMapper is
a default implementation of ActionMapper. It handles four types of
prefixed parameters: action:, redirect:, redirectAction: and method:.

Among these four prefixed parameters, redirect: and redirectAction: can
be used for open redirect attacks.

For example, redirect prefix is used for HTTP redirect.

Normal redirect prefix usage in JSP:
<s:form action="foo">
...
<s:submit value="Register"/>
<s:submit name="redirect:http://www.google.com/" value="Cancel"/>
</s:form>

If the cancel button is clicked, redirection is performed.

Request URI for redirection:
/foo.action?redirect:http://www.google.com/

Resopnse Header:
HTTP/1.1 302 Found
Location: http://www.google.com/

Usage of redirectAction: is similar to redirect.
See Struts2 document for details.
https://cwiki.apache.org/confluence/display/WW/ActionMapper

The problem is that applications cannot restrict destination URL of
redirect. Furthermore, prefixed parameters are quite forceful. It means
that behavior of application which is not intended to accept prefixed
parameters can also be overwritten by prefixed parameters added to HTTP
request.

Therefore any struts2 application that use DefaultActionMapper can be
open redirector simply by adding redirect: / redirectAction: prefixed
parameters.

The last thing that should be mentioned is that Struts2 passes redirect
URL to ServletHttpResponse#sendRedirect() even if the URL contains line
breaks. Impact of this behavior depends on the container server that
hosts Struts2.

As far as I know, recent versions of Tomcat filters line breaks, but a
few servers such as WebLogic do not filter line breaks (More precisely,
WebLogic blocks CR+LF sequence but you can bypass it in several ways).
In such server environment, the behavior of Struts2 apparently causes
HTTP response header injection.

Proof of Concept:
PoC is already disclosed on vender's web page.
https://struts.apache.org/release/2.3.x/docs/s2-017.html

Below PoC URLs are just quotes from the vender's page.
http://host/struts2-showcase/fileupload/upload.action?redirect:http://www.yahoo.com/
http://host/struts2-showcase/modelDriven/modelDriven.action?redirectAction:http://www.google.com/%23

HTTP response header injection PoC.
http://host/struts2-blank/example/HelloWorld.action?redirect:x%0ASet-Cookie:x%3D123
http://host/struts2-blank/example/HelloWorld.action?redirect:x%0DSet-Cookie:x%3D123
http://host/struts2-blank/example/HelloWorld.action?redirect:x%0D%0A+Set-Cookie:x%3D123
(These URLs work on specific servers and specific browsers only)

Timeline:
2013/06/26 Reported to Struts Security ML
2013/07/17 Vender announced v2.3.15.1
2013/08/10 Disclosure of this advisory

Recommendation:
Upgrade to the latest version. As stated in the vender's page,
redirect: and redirectAction: parameters were completely dropped and
do not work in the latest version. Thus attention for compatibility
issues is required for upgrade.

Reference:
https://struts.apache.org/release/2.3.x/docs/s2-017.html
https://cwiki.apache.org/confluence/display/WW/ActionMapper
Login or Register to add favorites

File Archive:

October 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close