Skip to content
NewCybercrime Report 2026 · Eight Chapters · A Post Is Not An Incident → Explore The ChaptersCybercrime Report 2026 → Explore

Odin Research / What is / Techniques and vulnerabilities

What Is Ghostcat (CVE-2020-1938)? The Apache Tomcat AJP Flaw

An old Tomcat flaw that still turns up in attacker toolkits: what Ghostcat is, why the AJP port is the problem, and how to close it for good.

By
Odin by Brandefense
Updated
21 Nov 2026
Reading time
4 min read
Type
Vulnerability

In short

Ghostcat is the common name for CVE-2020-1938, a critical flaw in the Apache JServ Protocol (AJP) connector of Apache Tomcat. On affected versions, an attacker who can reach the AJP port can read files from web applications and, in some setups, run code. NVD rates it CVSS 3.1 9.8, and CISA lists it as known exploited.

Key takeaways

What it is
CVE-2020-1938, an AJP connector flaw in Apache Tomcat 7.0.0 to 7.0.99, 8.5.0 to 8.5.50 and 9.0.0.M1 to 9.0.30.
How it works
Older Tomcat shipped an AJP connector, enabled by default, that listened on all addresses and trusted incoming AJP requests too much.
Why it matters
NVD scores it 9.8 (critical). CISA added it to the Known Exploited Vulnerabilities catalog on 3 March 2022.
What Odin Research saw
Nine Ghostcat scripts aimed at port 8009 inside a staged 364-file intrusion toolkit for moving through an internal network.
What to do first
Upgrade to Tomcat 9.0.31, 8.5.51 or 7.0.100 or later, disable AJP if unused, and never expose port 8009.

What is Ghostcat?

Ghostcat is the widely used name for CVE-2020-1938, a vulnerability in the AJP connector of Apache Tomcat. On affected versions, an attacker who can reach the AJP port can make Tomcat return files from inside web applications. Where the application lets users upload files, the flaw can lead to remote code execution.

The Apache Tomcat security team lists the issue as "AJP Request Injection and potential Remote Code Execution". It was reported to the team on 3 January 2020 and made public on 24 February 2020, the same day NVD published its record.

NVD rates Ghostcat CVSS 3.1 9.8 (critical). CISA added it to its Known Exploited Vulnerabilities catalog on 3 March 2022, under the name "Apache Tomcat Improper Privilege Management Vulnerability".

Ghostcat is old, but it is not gone. Legacy Tomcat servers stay in internal networks for years, and attackers who are already inside often find them.

How Ghostcat works

The Apache JServ Protocol (AJP) lets a front-end web server, such as Apache httpd with mod_jk or mod_proxy, pass requests to Tomcat. Tomcat's documentation explains why this needs care: AJP allows more direct manipulation of Tomcat's internal data structures than the HTTP connectors.

Two default settings made Ghostcat possible:

  1. AJP was on by default. Before 9.0.31, Tomcat shipped with an AJP connector enabled that listened on all configured IP addresses.
  2. AJP was trusted. NVD notes that Tomcat treated AJP connections as having higher trust than similar HTTP connections. An attacker who could reach the port could abuse that trust.

NVD describes the impact this way. An attacker can return arbitrary files from anywhere in the web application, including its configuration. If the application allows file upload and stores those files inside the web application, the attacker can have a file processed as a JSP page, which leads to remote code execution.

So Ghostcat is a file read flaw first. Code execution depends on how the application handles uploads.

Ghostcat affected and fixed versions

Tomcat branchAffectedFixed in
9.09.0.0.M1 to 9.0.309.0.31
8.58.5.0 to 8.5.508.5.51
7.07.0.0 to 7.0.997.0.100

The fix changed the default AJP connector configuration to harden it. Tomcat's security page warns that users upgrading will likely need small changes to their configurations as a result.

In current Tomcat documentation, the AJP connector listens on the loopback address by default. Its secretRequired attribute defaults to true, so the connector only starts when a non-empty secret is set. The documentation says to set secretRequired to false only on a trusted network.

What Odin Research observed

Monograph 01 studied an exposed staging server that held 364 attack files. Together, the files laid out a path from a perimeter web application through SQL Server and Oracle databases to Active Directory replication and VMware ESXi probing.

  • Nine Ghostcat scripts. Nine scripts targeted the Tomcat AJP Ghostcat flaw on port 8009. Seven of them named one internal host. The internal addresses stay withheld.
  • An internal target, not an internet one. The scripts were part of parallel tracks aimed at hosts inside the network: an Oracle database, Linux servers over SSH and an internal web app. That fits Ghostcat's profile as a flaw attackers find after they are already in.
  • Other old flaws beside it. The same server held two Log4Shell probes, which the operator filed under "failed attempts", and scripts adapted from a public proof of concept for an OpenSLP flaw on ESXi.
  • Tomcat as a relay. Separate files redeployed Tomcat relay JSP pages to restore SOCKS workers, showing how a Tomcat foothold can carry traffic deeper.

These are staged files. Odin Research holds no logs from the targeted network, so the report treats every step as staged capability. Related pages: Telerik UI, xp_cmdshell and DCSync.

How to detect Ghostcat exploitation

  • Find exposed AJP ports. Scan your own estate for listeners on port 8009, inside and at the edge. Any AJP port reachable from user or internet networks is a finding.
  • Check versions. Inventory Tomcat, including copies bundled inside other products. Anything below the fixed versions is vulnerable if AJP is on.
  • Watch AJP clients. Only the front-end web servers should talk to Tomcat's AJP port. Alert on any other source.
  • Watch the web worker. Odin Research's Monograph 01 carries a Sigma rule for Tomcat or java.exe spawning cmd.exe, PowerShell or certutil with stager-style arguments. A YARA rule there matches minimal JSP command shells. Both are in the Defense Kit.

The scripts Odin Research found targeted port 8009, the port many AJP deployments use. Check whatever port your own connectors are configured on.

How to fix Ghostcat

  1. Upgrade Tomcat to 9.0.31, 8.5.51 or 7.0.100 or later. Older branches that no longer get fixes should be replaced.
  2. Disable AJP if you do not use it. Many deployments never needed it.
  3. If you need AJP, lock it down. Bind it to loopback or a private interface with the address attribute, and set a long random secret that the front end must send.
  4. Firewall port 8009. Allow only the front-end web servers to reach it.
  5. Follow a patch process. Ghostcat shows how long old flaws live in internal networks. See patch management and how to respond to exploited vulnerabilities.

Frequently asked questions about Ghostcat

What is Ghostcat?

Ghostcat is the common name for CVE-2020-1938, a flaw in Apache Tomcat's AJP connector. It lets an attacker who can reach the AJP port read files from web applications and, in some setups, run code.

What is CVE-2020-1938?

CVE-2020-1938 is the CVE ID for Ghostcat. NVD rates it CVSS 3.1 9.8. It affects Tomcat 9.0.0.M1 to 9.0.30, 8.5.0 to 8.5.50 and 7.0.0 to 7.0.99.

Which port does Ghostcat use?

Ghostcat targets Tomcat's AJP connector, on whatever port it is configured to use. The staged Ghostcat scripts Odin Research found were aimed at port 8009.

Is Ghostcat still exploited?

CISA added CVE-2020-1938 to its Known Exploited Vulnerabilities catalog on 3 March 2022. Odin Research found Ghostcat scripts in a staged intrusion toolkit in 2026.

How do I fix Ghostcat?

Upgrade to Tomcat 9.0.31, 8.5.51 or 7.0.100 or later. Disable the AJP connector if you do not use it. Otherwise bind it to a private address, require a secret and firewall port 8009.

Can Ghostcat lead to remote code execution?

Yes, in some cases. NVD says that if an application allows file upload and stores files inside the web application, an attacker can have a file processed as a JSP, which leads to remote code execution.

Why is it called Ghostcat?

Ghostcat is the nickname the security community uses for CVE-2020-1938. The official Apache name is AJP Request Injection and potential Remote Code Execution.

Sources

  1. NVD, CVE-2020-1938. nvd.nist.gov/vuln/detail/CVE-2020-1938 (checked 21 November 2026)
  2. Apache Tomcat, Apache Tomcat 9.x vulnerabilities. tomcat.apache.org/security-9.html (checked 21 November 2026)
  3. Apache Tomcat 9 documentation, The AJP Connector. tomcat.apache.org/tomcat-9.0-doc/config/ajp.html (checked 21 November 2026)

Related tools and terms

All Odin Research explanations · Brandefense glossary

Odin Research

Get the rules, not just the definition

Every Odin Research report ships with verified indicators and detection rules you can load today.

Open the Defense Kit