Rapid7 Vulnerability & Exploit Database

Apache Struts 2 DefaultActionMapper Prefixes OGNL Code Execution

Back to Search

Apache Struts 2 DefaultActionMapper Prefixes OGNL Code Execution



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 mechanism 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.


  • Takeshi Terada
  • sinn3r <sinn3r@metasploit.com>
  • juan vazquez <juan.vazquez@metasploit.com>




Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/http/struts_default_action_mapper
msf exploit(struts_default_action_mapper) > show targets
msf exploit(struts_default_action_mapper) > set TARGET < target-id >
msf exploit(struts_default_action_mapper) > show options
    ...show and set options...
msf exploit(struts_default_action_mapper) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security