id: CVE-2016-3976 info: name: SAP NetWeaver AS Java (CrashFileDownloadServlet) - Directory Traversal author: ritikchaddha severity: high description: | A directory traversal vulnerability in SAP NetWeaver AS Java 7.10 through 7.50 (SAP Security Note 2234971, ERPScan ERPSCAN-16-012) allows a remote attacker to read arbitrary files via a ..\ (dot-dot-backslash) sequence in the fileName parameter of CrashFileDownloadServlet (EDB 39996). CVE-2016-3976 is in the CISA Known Exploited Vulnerabilities catalog. This template performs a safe read-only traversal to Windows win.ini and /etc/passwd and matches well-known file markers. The original ERPScan advisory redacted the servlet's deployment prefix (shown as /XXX/); this template probes the servlet at the common application root, so operators of non-root deployments may need to adjust the path. impact: | An attacker can read arbitrary files (including SAP secure store material such as security/data/SecStore.key) from the NetWeaver AS Java host, aiding further compromise. remediation: | Apply SAP Security Note 2234971 or upgrade to a fixed NetWeaver AS Java release. Restrict unauthenticated access to CrashFileDownloadServlet until patched. reference: - https://www.exploit-db.com/exploits/39996 - https://lists.openwall.net/full-disclosure/2016/06/18/2 - https://launchpad.support.sap.com/#/notes/2234971 - https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2016-3976 - https://nvd.nist.gov/vuln/detail/CVE-2016-3976 classification: cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N cvss-score: 7.5 cve-id: CVE-2016-3976 cwe-id: CWE-22 epss-score: 0.8746 epss-percentile: 0.99757 cpe: cpe:2.3:a:sap:netweaver_application_server_java:*:*:*:*:*:*:*:* metadata: max-request: 2 vendor: sap product: netweaver_application_server_java shodan-query: - http.html:"SAP NetWeaver" - http.title:"SAP NetWeaver" fofa-query: - body="SAP NetWeaver" - title="SAP NetWeaver" tags: cve,cve2016,sap,netweaver,lfi,traversal,kev,passive,vkev http: - method: GET path: - "{{BaseURL}}/" redirects: false extractors: - type: regex name: version part: header group: 1 internal: true regex: - '(?i)AS Java[/ ](\d+\.\d+)' - '(?i)SAP J2EE Engine/(\d+\.\d+)' - type: regex part: header group: 1 regex: - '(?i)AS Java[/ ](\d+\.\d+)' - '(?i)SAP J2EE Engine/(\d+\.\d+)' matchers: - type: dsl dsl: - 'compare_versions(version, ">= 7.10", "<= 7.50")' # digest: 4a0a0047304502201ce8a234eac7f65a608f567097731200b8c6af5955e347350f45d7e771cf3a8d022100a1357961a50b6fa879455a09194fc24cc5b382bcbf548a71c522a8cd55626e52:922c64590222798bb761d5b6d8e72950