Apache Tomcat
Apache Tomcat Improper Privilege Management Vulnerability
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.
Affected versions and mitigation
From the CVE record, GitHub Security Advisories and the vendor's references.Affected
- >= 9.0.0, < 9.0.31
Fixed in 9.0.31
from GitHub Security Advisory GHSA-c9hw-wf7x-jp9j
- >= 8.0.0, < 8.5.51
Fixed in 8.5.51
from GitHub Security Advisory GHSA-c9hw-wf7x-jp9j
- >= 7.0.0, < 7.0.100
Fixed in 7.0.100
from GitHub Security Advisory GHSA-c9hw-wf7x-jp9j
Mitigation
Upgrade org.apache.tomcat.embed:tomcat-embed-core to 9.0.31 or later.
Upgrade org.apache.tomcat.embed:tomcat-embed-core to 8.5.51 or later.
Upgrade org.apache.tomcat.embed:tomcat-embed-core to 7.0.100 or later.
Timeline
Days relative to CVE publicationFirst public PoC 4.9 days before publication; added to CISA KEV 2.0 years after publication. First PoC: Apache Tomcat - AJP 'Ghostcat File Read/Inclusion (Exploit-DB, 20 Feb 2020).
PoC repositories
Found on GitHub.36 PoCs · 7 pending · 13 informational · 3 suspicious or fake
PoCs 36
| Repository | Created | Found by us | Stars | Assessment |
|---|---|---|---|---|
| LandGrey/ClassHound | 6 Jun 2019 −263 d | backfilled | 710 | PoC older repo: PoC date unknown, not used for the first PoC |
| xindongzhuaizhuai/CVE-2020-1938 | 20 Feb 2020 −4.2 d | backfilled | 45 | PoC |
| sv3nbeast/CVE-2020-1938-Tomact-file_include-file_read | 21 Feb 2020 −3.6 d | backfilled | 57 | PoC |
| fairyming/CVE-2020-1938 | 21 Feb 2020 −3.5 d | backfilled | 11 | PoC |
| dacade/CVE-2020-1938 | 21 Feb 2020 −3.5 d | backfilled | 9 | PoC |
| woaiqiukui/CVE-2020-1938TomcatAjpScanner | 21 Feb 2020 −3.3 d | backfilled | 15 | PoC |
| fatal0/tomcat-cve-2020-1938-check | 21 Feb 2020 −3.2 d | backfilled | 7 | Scanner |
| delsadan/CNVD-2020-10487-Bulk-verification | 22 Feb 2020 −2.3 d | backfilled | 3 | Scanner |
| 00theway/Ghostcat-CNVD-2020-10487 | 22 Feb 2020 −2.2 d | backfilled | 424 | PoC older repo: PoC date unknown, not used for the first PoC |
| aihuonaicha/tomcat | 24 Feb 2020 −19 h | backfilled | 0 | PoC older repo: PoC date unknown, not used for the first PoC |
| b1cat/CVE_2020_1938_ajp_poc | 26 Feb 2020 +1.6 d | backfilled | 0 | PoC |
| w4fz5uck5/CVE-2020-1938-Clean-Version | 1 Mar 2020 +5.2 d | backfilled | 6 | PoC |
| whatboxapp/GhostCat-LFI-exp | 3 Mar 2020 +7.2 d | backfilled | 0 | PoC |
| Just1ceP4rtn3r/CVE-2020-1938-Tool | 20 Mar 2020 +25 d | backfilled | 3 | PoC |
| naozibuhao/CNVD-2020-10487-Tomcat-ajp-POC-A | 27 Mar 2020 +31 d | backfilled | 1 | PoC |
| dacade/CVE-POC | 7 Jun 2020 +104 d | backfilled | 6 | PoC |
| acodervic/CVE-2020-1938-MSF-MODULE | 1 Feb 2021 +342 d | backfilled | 0 | PoC via PoC Index |
| Hancheng-Lei/Hacking-Vulnerability-CVE-2020-1938-Ghostcat | 28 Mar 2021 +1.1 y | backfilled | 24 | PoC |
| Neko-chanQwQ/CVE-2020-1938 | 11 Jul 2021 +1.4 y | backfilled | 1 | PoC |
| wukong-bin/PeiQi-LandGrey-ClassHound | 2 Mar 2022 +2.0 y | backfilled | 0 | PoC |
| YounesTasra-R4z3rSw0rd/CVE-2020-1938 | 21 Aug 2022 +2.5 y | backfilled | 3 | PoC |
| 0xdc10/tomghost-thm | 30 Jan 2024 +3.9 y | backfilled | 0 | PoC |
| Warelock/cve-2020-1938 | 14 Apr 2024 +4.1 y | backfilled | 2 | PoC |
| RedTeam-Rediron/CVE-2020-1938 | 20 Aug 2024 +4.5 y | backfilled | 0 | PoC |
| WHtig3r/CVE-2020-1938 | 20 Aug 2024 +4.5 y | backfilled | 0 | PoC |
| lizhianyuguangming/TomcatScanPro | 29 Aug 2024 +4.5 y | backfilled | 300 | PoC |
| ZapcoMan/TomcatVulnToolkit | 3 Jan 2025 +4.9 y | backfilled | 10 | PoC via PoC Index |
| parzival-4/Tomcat-ajp-filedownload | 2 Sep 2025 +5.5 y | backfilled | 0 | PoC via PoC Index |
| abrewer251/CVE-2020-1938_Ghostcat-PoC | 11 Dec 2025 +5.8 y | backfilled | 0 | PoC |
| With-fate/CVE-2020-1938 | 7 Apr 2026 +6.1 y | backfilled | 1 | PoC |
| si1ence90/Ghostcat-Tomcat-AJP-Exploit-Py3 | 8 May 2026 +6.2 y | backfilled | 0 | PoC via PoC Index |
| cyberguardsec101-sketch/ghostcat | 9 May 2026 +6.2 y | backfilled | 0 | PoC |
| lem0n817/tomcatfileread | 4 Sep 2026 +6.5 y | backfilled | 0 | PoC |
| CyberCTF/vulhub-tomcat-cve-2020-1938 | 8 Oct 2026 +6.6 y | backfilled | 0 | PoC |
| zhengjunyi23-source/lab1-secure-api | 27 Oct 2026 +6.7 y | 14 Nov 2026 | 0 | PoC |
| Mohammad-Anon/CVE-2020-1938 | 13 Nov 2026 +6.7 y | 14 Nov 2026 | 0 | PoC |
Pending 7
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| bkfish/CNVD-2020-10487-Tomcat-Ajp-lfi-Scanner | 20 Feb 2020 −4 d | 294 | Pending |
| G1ngerCat/Tools_G1ngerCat | 19 Mar 2022 +2.1 y | 1 | Pending · repository exceeds size limit via PoC Index
Flags · score 30
Below the suspicion threshold (50); does not change the assessment. |
| duckpigdog/Tomcat-AJP-CVE-2020-1938 | 25 May 2026 +6.2 y | 0 | Pending · mkdir /quarantine/duckpigdog__Tomcat-AJP-CVE-2020-1938-63ccba621784: permission denied |
| Zaziki1337/Ghostcat-CVE-2020-1938 | unknown | 0 | Pending · repository unavailable (HTTP 404) |
| kukudechen-chen/cve-2020-1938 | unknown | 0 | Pending · repository unavailable (HTTP 404) |
| s3nd3rjz/poc-CVE-2020-1938 | unknown | 0 | Pending · repository unavailable (HTTP 404) |
| technicalcorp2/CVE-2020-1938-Exploit | unknown | 0 | Pending · repository unavailable (HTTP 404) |
Informational 13
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| laolisafe/CVE-2020-1938 | 21 Feb 2020 −3.8 d | 38 | Informational · write-up |
| DaemonShao/CVE-2020-1938 | 21 Feb 2020 −3.7 d | 2 | Informational · write-up |
| h7hac9/CVE-2020-1938 | 21 Feb 2020 −3.7 d | 2 | Informational · write-up |
| shaunmclernon/ghostcat-verification | 26 Feb 2020 +1.7 d | 1 | Informational · write-up |
| doggycheng/CNVD-2020-10487 | 27 Mar 2020 +31 d | 8 | Informational · detection |
| I-Runtime-Error/CVE-2020-1938 | 12 May 2020 +78 d | 0 | Informational · write-up |
| Umesh2807/Ghostcat | 12 May 2020 +78 d | 0 | Informational · write-up
Flags · score 30
Below the suspicion threshold (50); does not change the assessment. |
| MateoSec/ghostcatch | 17 Jul 2020 +144 d | 0 | Informational · detection
Flags · score 30
Below the suspicion threshold (50); does not change the assessment. |
| streghstreek/CVE-2020-1938 | 27 Apr 2021 +1.2 y | 1 | Informational · write-up |
| haerin7427/CVE_2020_1938 | 22 Jul 2021 +1.4 y | 0 | Informational · write-up |
| hopsypopsy8/CVE-2020-1938-Exploitation | 15 Feb 2025 +5.0 y | 0 | Informational · write-up |
| sangrok-jeon/CVE-2020-1938-Tomcat-AJP-Ghostcat--Analysis | 8 Apr 2026 +6.1 y | 0 | Informational · write-up |
| aidilzlkfli/Scanning | 6 May 2026 +6.2 y | 0 | Informational · write-up |
Suspicious or fake 3
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| sgdream/CVE-2020-1938 | 20 Feb 2020 −4.2 d | 3 | Fake |
| jptr218/ghostcat | 14 Aug 2021 +1.5 y | 1 | Fake |
| tpt11fb/AttackTomcat | 13 Nov 2022 +2.7 y | 259 | Suspicious · score 60
Why suspicious
|
Only PoCs count toward the first-PoC date and the characteristics below. Suspicious repositories (score ≥ 50) never count. "Backfilled" means we found the repository more than 30 days after it was created. Do not run PoC code from unknown sources.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| Exploit-DB | Apache Tomcat - AJP 'Ghostcat File Read/Inclusion | 20 Feb 2020 | 14 Nov 2026 |
| Exploit-DB | Apache Tomcat - AJP 'Ghostcat' File Read/Inclusion (Metasploit) | 13 Nov 2020 | 14 Nov 2026 |
| Metasploit | Metasploit auxiliary: Apache Tomcat AJP File Read (auxiliary/admin/http/tomcat_ghostcat) | 16 Nov 2020 | 14 Nov 2026 |
| nuclei template | nuclei template: Ghostcat - Apache Tomcat - AJP File Read/Inclusion Vulnerability | 27 Apr 2023 | 14 Nov 2026 |
PoC characteristics
What to hunt for in your logs · from 37 PoC reposGET /manager/html
- Key headers
Authorization: Basic {base64(user:pass)}- Ports
- 80, 1080, 3128
- PoC User-Agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3- Seen in
- 2 repos: ZapcoMan/TomcatVulnToolkit, lizhianyuguangming/TomcatScanPro
- Evidence
- ZapcoMan/TomcatVulnToolkit/TomcatScan.py:145 ZapcoMan/TomcatVulnToolkit/TomcatScan.py:291 lizhianyuguangming/TomcatScanPro/TomcatScanPro.py:81 lizhianyuguangming/TomcatScanPro/TomcatScanPro.py:175 lizhianyuguangming/TomcatScanPro/TomcatScanPro.py:80-81 lizhianyuguangming/TomcatScanPro/README.md:44-45
POST /manager/html/upload
- Query
org.apache.catalina.filters.CSRF_NONCE=- Key headers
Authorization: Basic {base64(user:pass)}Cookie: JSESSIONID={var}- Body markers
name="file_field_name"filename="{var}.war"application/octet-streaminmultipart/form-data- Ports
- 80, 1080, 3128
- Seen in
- 2 repos: ZapcoMan/TomcatVulnToolkit, lizhianyuguangming/TomcatScanPro
- Evidence
- ZapcoMan/TomcatVulnToolkit/TomcatScan.py:216 lizhianyuguangming/TomcatScanPro/TomcatScanPro.py:129 lizhianyuguangming/TomcatScanPro/TomcatScanPro.py:125-130
GET /{var}/{var}
- Ports
- 80, 1080, 3128
- Seen in
- 2 repos: ZapcoMan/TomcatVulnToolkit, lizhianyuguangming/TomcatScanPro
- Evidence
- ZapcoMan/TomcatVulnToolkit/TomcatScan.py:223 lizhianyuguangming/TomcatScanPro/TomcatScanPro.py:133
GET /api/data
- Key headers
Authorization: Bearer {var}Authorization: Bearer not.a.valid.token- Ports
- 5000, 8080
- Seen in
- 1 repo: zhengjunyi23-source/lab1-secure-api
- Evidence
- zhengjunyi23-source/lab1-secure-api/README.md:38 zhengjunyi23-source/lab1-secure-api/tests/test_api.py:41 zhengjunyi23-source/lab1-secure-api/tests/test_api.py:47 zhengjunyi23-source/lab1-secure-api/tests/test_api.py:55 zhengjunyi23-source/lab1-secure-api/tests/test_api.py:64
GET /api/me
- Key headers
Authorization: Bearer {var}- Ports
- 5000
- Seen in
- 1 repo: zhengjunyi23-source/lab1-secure-api
- Evidence
- zhengjunyi23-source/lab1-secure-api/README.md:41
GET /authenticationserverservlet/
- Seen in
- 1 repo: dacade/CVE-POC
- Evidence
- dacade/CVE-POC/CNVD-2021-10543/CNVD-2021-10543.py:76
GET /tool/log/c.php
- Query
strip_slashes=systemhost=echo "dacade"/tool/log/c.php?strip_slashes=systemhost=echo "dacade"- PoC User-Agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36- Seen in
- 1 repo: dacade/CVE-POC
- Evidence
- dacade/CVE-POC/深信服EDR/edr.py:13 dacade/CVE-POC/深信服EDR/edr.py:26
POST /auth/login
- Body markers
"username":"alice""password":"S3cure#Passw0rd""username""password""password":"wrong-password""username":"' OR '1'='1' --""password":"anything"inapplication/json- Ports
- 5000, 8080
- Seen in
- 1 repo: zhengjunyi23-source/lab1-secure-api
- Evidence
- zhengjunyi23-source/lab1-secure-api/README.md:32 zhengjunyi23-source/lab1-secure-api/tests/test_api.py:19 zhengjunyi23-source/lab1-secure-api/tests/test_api.py:33 zhengjunyi23-source/lab1-secure-api/tests/test_api.py:73
GET /{var}/{var}.jsp
- Key headers
Authorization: Basic {base64(user:pass)}Cookie: JSESSIONID={var}- Seen in
- 1 repo: lizhianyuguangming/TomcatScanPro
- Evidence
- lizhianyuguangming/TomcatScanPro/TomcatScanPro.py:132-134
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/manager/html(?:[?#].*)?$
(?i)^/manager/html/upload\?(?:.*&)?org\.apache\.catalina\.filters\.CSRF_NONCE=
(?i)^/[^/?#]*/[^/?#]*(?:[?#].*)?$
(?i)^/api/data(?:[?#].*)?$
(?i)^/api/me(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET [80,1080,3128] (msg:"GG PoC-Monitor CVE-2020-1938 Apache Apache Tomcat exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/manager/html"; http.header; content:"Authorization: Basic {base64(user:pass)}"; nocase; reference:url,poc.griffinguard.io/cve/CVE-2020-1938; classtype:web-application-attack; sid:9885476; rev:1;)
alert http any any -> $HOME_NET [80,1080,3128] (msg:"GG PoC-Monitor CVE-2020-1938 Apache Apache Tomcat exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/manager/html/upload"; http.uri; content:"org.apache.catalina.filters.CSRF_NONCE="; http.header; content:"Authorization: Basic {base64(user:pass)}"; nocase; http.header; content:"Cookie: JSESSIONID="; nocase; http.request_body; content:"name=|22|file_field_name|22|"; http.request_body; content:"filename=|22|"; http.request_body; content:"application/octet-stream"; reference:url,poc.griffinguard.io/cve/CVE-2020-1938; classtype:web-application-attack; sid:9100462; rev:1;)
alert http any any -> $HOME_NET [80,1080,3128] (msg:"GG PoC-Monitor CVE-2020-1938 Apache Apache Tomcat exploit attempt"; flow:established,to_server; http.method; content:"GET"; reference:url,poc.griffinguard.io/cve/CVE-2020-1938; classtype:web-application-attack; sid:9603092; rev:1;)
alert http any any -> $HOME_NET [5000,8080] (msg:"GG PoC-Monitor CVE-2020-1938 Apache Apache Tomcat exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/api/data"; http.header; content:"Authorization: Bearer "; nocase; http.header; content:"Authorization: Bearer not.a.valid.token"; nocase; reference:url,poc.griffinguard.io/cve/CVE-2020-1938; classtype:web-application-attack; sid:9002264; rev:1;)
alert http any any -> $HOME_NET [5000] (msg:"GG PoC-Monitor CVE-2020-1938 Apache Apache Tomcat exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/api/me"; http.header; content:"Authorization: Bearer "; nocase; reference:url,poc.griffinguard.io/cve/CVE-2020-1938; classtype:web-application-attack; sid:9884358; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: Apache Apache Tomcat exploit attempt (CVE-2020-1938)
id: gg-pocmon-cve-2020-1938-9885476
status: experimental
description: Request pattern taken from public PoCs for CVE-2020-1938. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2020-1938
logsource:
category: webserver
detection:
selection:
cs-method: GET
cs-uri-stem|contains|all:
- '/manager/html'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2020.1938
title: Apache Apache Tomcat exploit attempt (CVE-2020-1938)
id: gg-pocmon-cve-2020-1938-9100462
status: experimental
description: Request pattern taken from public PoCs for CVE-2020-1938. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2020-1938
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/manager/html/upload'
cs-uri-query|contains|all:
- 'org.apache.catalina.filters.CSRF_NONCE='
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2020.1938
title: Apache Apache Tomcat exploit attempt (CVE-2020-1938)
id: gg-pocmon-cve-2020-1938-9603092
status: experimental
description: Request pattern taken from public PoCs for CVE-2020-1938. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2020-1938
logsource:
category: webserver
detection:
selection:
cs-method: GET
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2020.1938
title: Apache Apache Tomcat exploit attempt (CVE-2020-1938)
id: gg-pocmon-cve-2020-1938-9002264
status: experimental
description: Request pattern taken from public PoCs for CVE-2020-1938. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2020-1938
logsource:
category: webserver
detection:
selection:
cs-method: GET
cs-uri-stem|contains|all:
- '/api/data'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2020.1938
title: Apache Apache Tomcat exploit attempt (CVE-2020-1938)
id: gg-pocmon-cve-2020-1938-9884358
status: experimental
description: Request pattern taken from public PoCs for CVE-2020-1938. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2020-1938
logsource:
category: webserver
detection:
selection:
cs-method: GET
cs-uri-stem|contains|all:
- '/api/me'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2020.1938