Skip to main content

Wolfcore Cyber Security

Port 8009 (AJP and Ghostcat): Risks and How to Close It

Written by Ruben Selby, founder and penetration tester at Wolfcore. Last reviewed 20 November 2026.

In one sentence: Port 8009 lets a front web server hand requests to a Tomcat application server, and if it is reachable by outsiders it can give them far more access than the website itself would.

What runs on this port

AJP is the Apache JServ Protocol. The Tomcat documentation describes the AJP connector as a way to put Tomcat behind an existing Apache web server, which then handles static content and encryption. Tomcat’s own documentation warns that AJP needs extra security care because it allows greater direct manipulation of Tomcat’s internal data than the normal HTTP connectors. The conventional port is 8009.

Why attackers look for it

AJP is meant to be internal, between two servers you control. When it is reachable from the internet, scanners that map open ports will record it. Attackers search for 8009 on hosts also running Java web applications.

How it gets attacked

The best known case is CVE-2020-1938, nicknamed Ghostcat. The NVD record says Tomcat treats AJP connections as more trusted than a similar HTTP connection. In Tomcat 9.0.0.M1 to 9.0.30, 8.5.0 to 8.5.50 and 7.0.0 to 7.0.99, an AJP connector was enabled by default and listened on all configured addresses. The flaw allowed arbitrary files in the web application to be returned, and any file in the application to be processed as a JSP. If the application also let users upload files that were stored inside it, this could lead to remote code execution. NVD lists a base score of 9.8 and shows it in the CISA Known Exploited Vulnerabilities catalogue, added 3 March 2022.

NVD stresses that the fix is only needed if the AJP port is reachable by untrusted users. The patched releases are 9.0.31, 8.5.51 and 7.0.100 or later, which also harden the default AJP configuration.

Other common weaknesses are a connector left on when nothing uses it, no shared secret between the web server and Tomcat, and old Tomcat versions that are never updated.

Who it affects and how badly

  • Any size running Java web apps on Tomcat: the issue is about exposure, not company size.
  • Mid-sized businesses and SaaS start-ups: old internal portals, intranets and ageing line-of-business apps often sit on out-of-date Tomcat. Worst case is configuration files, database credentials or source being read, then a way in.
  • Regulated firms, councils and healthcare: read access to application files can expose credentials that lead to personal data, with reporting duties and client questions to follow.

What we check on a test

  • Whether 8009 answers from outside the network, and from which hosts.
  • Whether the Tomcat version is on the NVD affected list for CVE-2020-1938.
  • Whether the AJP connector is needed at all, and what address, secret and secretRequired are set to.
  • Whether the application stores uploaded files inside the web application folder.
  • Whether credentials sit in files an application could serve.
Internet scanfinds port 8009→AJP connectortrusted by Tomcat→Files in the webapp can be read→Fix: bind toloopback, set secret,patch Tomcat

How to check whether yours is exposed

  1. Find every Tomcat server in your asset list and note its version.
  2. Open server.xml and look for a Connector with protocol="AJP/1.3".
  3. Review firewall and cloud security group rules for inbound 8009.
  4. Use the free scan at free web vulnerability scan and our open ports guide at /resources/security-tools/how-to-check-which-ports-are-open-on-your-network/.

How to secure it

  1. Block 8009 from everywhere except the front web server.
  2. If you do not use AJP, remove or comment out the AJP connector.
  3. Update Tomcat to a supported release, at minimum 9.0.31, 8.5.51 or 7.0.100, and preferably the current one.
  4. If you use AJP, keep secretRequired at its documented default of true and set a long secret, matching it on the front end.
  5. Leave the connector listening on the loopback address, which is the documented default for address, unless the front server is on another machine.
  6. Do not store uploaded files inside the web application folder.

Closing the port fixes the server, but staff are a separate way in. You can test how your team handles a fake email with Phishy phishing simulation software, and begin with the free trial.

Another dashboard port that is often left open is covered in the port 5601 (Kibana) entry.

Illustration: worked example

A 40-person estate agency runs an old property portal on Tomcat 8.5.40, installed years ago by a contractor. The firewall allows all ports to that server for “easy support”. A reachable AJP port lets an outsider read application files, including a database password. Cost: a rebuilt server, password resets, and a data protection assessment. Fix: patch, close 8009, move uploads out of the app folder.

FAQ

What port does AJP use? 8009 is the conventional port, and Tomcat lets you change it with the port attribute.

Is Ghostcat still a risk? NVD says mitigation is only required if the AJP port is reachable by untrusted users, so old unpatched and exposed servers remain the issue.

Which Tomcat versions fixed it? 9.0.31, 8.5.51 and 7.0.100 or later.

Related terms

port 80 http, port 443 https, how to check which ports are open on your network, how eternalblue ms17 010 works, least privilege

More in the Ports and protocols hub.

Sources opened for this entry

How Wolfcore helps

A Wolfcore penetration test finds this the way an attacker would, by hand, not with a scanner. Start with the free web vulnerability scan at free web vulnerability scan or see penetration testing.

Wolfcore

Would your staff click a phishing email?

Run a real, safe phishing test on your team with Phishy. Free for 14 days, up to 10 staff, no card. We help you set it up.

Start a free phishing testFree website security scanor book a 30 minute call