Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Ghostcat, CVE-2020-1938, let anyone who could reach Apache Tomcat’s AJP connector read files from inside the web application — including configuration files full of credentials.

What Is Ghostcat?
Ghostcat is CVE-2020-1938, a vulnerability in the Apache JServ Protocol connector of Apache Tomcat, found by Chaitin Tech and disclosed on 20 February 2020. Anyone able to reach the AJP port — 8009 by default — could read any file inside the web application directory, and in some configurations could escalate that to remote code execution.
It affected Tomcat 6, 7.x before 7.0.100, 8.x before 8.5.51, and 9.x before 9.0.31, which is to say almost every Tomcat deployment in existence at the time.
AJP is a binary protocol that lets a front-end web server, classically Apache HTTP Server or IIS with a connector module, pass requests to Tomcat more efficiently than plain HTTP. The design assumes the front end is trusted, so AJP allows the caller to set request attributes that an ordinary HTTP client could never set — including attributes that the servlet container uses internally.
Three of those attributes are the problem:
javax.servlet.include.request_urijavax.servlet.include.path_infojavax.servlet.include.servlet_pathSetting them makes Tomcat treat the request as an internal include of a path the attacker chose. Pointing that path at /WEB-INF/web.xml returns the deployment descriptor. Pointing it elsewhere returns source files, property files, and anything else inside the application.
The read on its own is serious enough. Configuration files in WEB-INF routinely contain database connection strings with credentials, API keys, and framework secrets such as a session signing key.
Code execution follows where the application allows a file to be uploaded anywhere inside its directory — an avatar image, a document attachment, a temporary export. The attacker uploads a file containing JSP source, which is harmless as an image, then uses the include attributes to make Tomcat process that file as a JSP. The container compiles and executes it, producing a web shell.
For many years Tomcat shipped with the AJP connector enabled by default and bound to all interfaces. Administrators deploying Tomcat directly, without a front-end web server, had no reason to think about a connector they were not using, and it was invisible in routine functional testing. Mass scanning for port 8009 began within days of disclosure, and the flaw was quickly adopted by cryptomining and ransomware operations.
<Connector port="8009" protocol="AJP/1.3"> element in server.xml. Most deployments that front Tomcat with a cloud load balancer or a reverse proxy over HTTP have no need for it.127.0.0.1 or an internal address, set a secret with secretRequired="true", and configure allowedRequestAttributesPattern restrictively.Ghostcat is a good illustration of a recurring class: a protocol designed for a trusted internal link, exposed on an interface it was never meant to reach. The same shape appears in exposed Redis and MongoDB instances, unauthenticated Docker daemons, Kubernetes API servers, and management protocols such as IPMI. In every case the software is behaving exactly as designed, and the vulnerability is the network position.
Scan your own estate for ports that exist because a default configuration put them there. It is one of the higher-yield exercises available, and the findings are usually services nobody knew were listening.
Discovering exactly this kind of unintended exposure is part of our infrastructure security testing services.
Tomcat 6, 7.x before 7.0.100, 8.x before 8.5.51, and 9.x before 9.0.31. Tomcat 6 reached end of life in 2016 and received no fix, so affected installations must be migrated rather than patched. Later releases disable the AJP connector by default and restrict it to localhost when it is enabled.
Primarily an arbitrary file read within the web application directory, which commonly exposes configuration files containing credentials. It becomes remote code execution where the application lets an attacker upload a file anywhere inside that directory, because the include attributes can then make Tomcat compile and run the uploaded content as a JSP.
Only if a front-end web server such as Apache HTTP Server or IIS proxies to Tomcat using AJP. Deployments that sit behind a reverse proxy or load balancer speaking HTTP or HTTPS do not need it, and most modern architectures fall into that category. If you are unsure, disable it and test; the failure mode is obvious and immediate.
No. If the connector was reachable from an untrusted network, assume configuration files were read and rotate every credential and secret they contained, including database passwords, API keys, and session signing keys. Also check for uploaded files and unexpected JSP content in the application directory, since code execution may have followed the file read.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.