CVE-2020-1938
CVE-2020-1938
In short
Apache Tomcat's AJP protocol connector was enabled by default and trusted too much, allowing attackers to read any file from the web application or execute code by treating files as JSP scripts if they could access this connector.
Technical detail
The AJP Connector in Tomcat 9.0.0.M1-9.0.0.30, 8.5.0-8.5.50, and 7.0.0-7.0.99 was enabled by default on all interfaces with insufficient input validation. An attacker with network access to the AJP port can exploit request smuggling or path traversal to retrieve arbitrary files or execute arbitrary JSP code, leading to remote code execution if combined with file upload capabilities.
Summary generated and translated by AI from the official description.
When using the Apache JServ Protocol (AJP), care must be taken when trusting incoming connections to Apache Tomcat. Tomcat treats AJP connections as having higher trust than, for example, a similar HTTP connection. If such connections are available to an attacker, they can be exploited in ways that may be surprising. In Apache Tomcat 9.0.0.M1 to 9.0.0.30, 8.5.0 to 8.5.50 and 7.0.0 to 7.0.99, Tomcat shipped with an AJP Connector enabled by default that listened on all configured IP addresses. It was expected (and recommended in the security guide) that this Connector would be disabled if not required. This vulnerability report identified a mechanism that allowed: - returning arbitrary files from anywhere in the web application - processing any file in the web application as a JSP Further, if the web application allowed file upload and stored those files within the web application (or the attacker was able to control the content of the web application by some other means) then this, along with the ability to process a file as a JSP, made remote code execution possible. It is important to note that mitigation is only required if an AJP port is accessible to untrusted users. Users wishing to take a defence-in-depth approach and block the vector that permits returning arbitrary files and execution as JSP may upgrade to Apache Tomcat 9.0.31, 8.5.51 or 7.0.100 or later. A number of changes were made to the default AJP Connector configuration in 9.0.31 to harden the default configuration. It is likely that users upgrading to 9.0.31, 8.5.51 or 7.0.100 or later will need to make small changes to their configurations.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Affected products
Apache · Apache Tomcatpublic PoCs found — 40
githubgithub.com/00theway/Ghostcat-CNVD-2020-10487★ 417githubgithub.com/bkfish/CNVD-2020-10487-Tomcat-Ajp-lfi-Scanner★ 292githubgithub.com/lizhianyuguangming/TomcatScanPro★ 291githubgithub.com/tpt11fb/AttackTomcat★ 254githubgithub.com/sv3nbeast/CVE-2020-1938-Tomact-file_include-file_read★ 52githubgithub.com/xindongzhuaizhuai/CVE-2020-1938★ 45githubgithub.com/laolisafe/CVE-2020-1938★ 38githubgithub.com/Hancheng-Lei/Hacking-Vulnerability-CVE-2020-1938-Ghostcat★ 17githubgithub.com/woaiqiukui/CVE-2020-1938TomcatAjpScanner★ 14githubgithub.com/fairyming/CVE-2020-1938★ 11githubgithub.com/dacade/CVE-2020-1938★ 9githubgithub.com/doggycheng/CNVD-2020-10487★ 8githubgithub.com/fatal0/tomcat-cve-2020-1938-check★ 7githubgithub.com/w4fz5uck5/CVE-2020-1938-Clean-Version★ 6githubgithub.com/delsadan/CNVD-2020-10487-Bulk-verification★ 3githubgithub.com/YounesTasra-R4z3rSw0rd/CVE-2020-1938★ 3githubgithub.com/sgdream/CVE-2020-1938★ 3githubgithub.com/Just1ceP4rtn3r/CVE-2020-1938-Tool★ 3githubgithub.com/Warelock/cve-2020-1938★ 2githubgithub.com/h7hac9/CVE-2020-1938★ 2githubgithub.com/jptr218/ghostcat★ 1githubgithub.com/With-fate/CVE-2020-1938★ 1githubgithub.com/shaunmclernon/ghostcat-verification★ 1githubgithub.com/streghstreek/CVE-2020-1938★ 1githubgithub.com/Neko-chanQwQ/CVE-2020-1938★ 1githubgithub.com/acodervic/CVE-2020-1938-MSF-MODULE★ 0githubgithub.com/whatboxapp/GhostCat-LFI-exp★ 0githubgithub.com/I-Runtime-Error/CVE-2020-1938★ 0githubgithub.com/Umesh2807/Ghostcat★ 0githubgithub.com/MateoSec/ghostcatch★ 0githubgithub.com/RedTeam-Rediron/CVE-2020-1938★ 0githubgithub.com/hopsypopsy8/CVE-2020-1938-Exploitation★ 0githubgithub.com/abrewer251/CVE-2020-1938_Ghostcat-PoC★ 0githubgithub.com/sangrok-jeon/CVE-2020-1938-Tomcat-AJP-Ghostcat--Analysis★ 0githubgithub.com/aidilzlkfli/Scanning★ 0githubgithub.com/si1ence90/Ghostcat-Tomcat-AJP-Exploit-Py3★ 0githubgithub.com/cyberguardsec101-sketch/ghostcat★ 0githubgithub.com/duckpigdog/Tomcat-AJP-CVE-2020-1938★ 0exploitdbwww.exploit-db.com/exploits/48143unverifiedexploitdbwww.exploit-db.com/exploits/49039unverified⚠ Public resources, to assess the exposure of systems you control or are authorized to test. Test only with authorization.
Want to know if your infrastructure is exposed to this?
Talk to TrueHacking →References
http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00025.htmlhttp://lists.opensuse.org/opensuse-security-announce/2020-05/msg00002.htmlhttps://lists.apache.org/thread.html/r089dc67c0358a1556dd279c762c74f32d7a254a54836b7ee2d839d8e%40%3Cdev.tomee.apache.org%3Ehttps://lists.apache.org/thread.html/r1125f3044a0946d1e7e6f125a6170b58d413ebd4a95157e4608041c7%40%3Cannounce.apache.org%3Ehttps://lists.apache.org/thread.html/r17aaa3a05b5b7fe9075613dd0c681efa60a4f8c8fbad152c61371b6e%40%3Cusers.tomcat.apache.org%3Ehttps://lists.apache.org/thread.html/r38a5b7943b9a62ecb853acc22ef08ff586a7b3c66e08f949f0396ab1%40%3Cusers.tomcat.apache.org%3Ehttps://lists.apache.org/thread.html/r43faacf64570b1d9a4bada407a5af3b2738b0c007b905f1b6b608c65%40%3Cusers.tomcat.apache.org%3Ehttps://lists.apache.org/thread.html/r47caef01f663106c2bb81d116b8380d62beac9e543dd3f3bc2c2beda%40%3Ccommits.tomee.apache.org%3Ehttps://lists.apache.org/thread.html/r4afa11e0464408e68f0e9560e90b185749363a66398b1491254f7864%40%3Cusers.tomcat.apache.org%3Ehttps://lists.apache.org/thread.html/r4f86cb260196e5cfcbbe782822c225ddcc70f54560f14a8f11c6926f%40%3Cusers.tomcat.apache.org%3Ehttps://lists.apache.org/thread.html/r549b43509e387a42656f0641fa311bf27c127c244fe02007d5b8d6f6%40%3Cdev.tomcat.apache.org%3Ehttps://lists.apache.org/thread.html/r57f5e4ced436ace518a9e222fabe27fb785f09f5bf974814cc48ca97%40%3Ccommits.tomee.apache.org%3E