# CVE-2024-52318: Apache Tomcat XSS in generated JSPs

Source: https://junglewise.ai/threats/cve-2024-52318-apache-tomcat-xss-in-generated-jsps  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-11-18. Updated: 2026-06-18  
License: CC BY 4.0 with a link back

CVE-2024-52318 · Severity: medium · CVSS 6.1 · Published 2024-11-18

Apache Tomcat is a widely used web server for hosting Java-based applications. A flaw in how it handles certain web page components (JSP tags) could allow an attacker to inject malicious scripts into a user's browser. This could lead to unauthorized actions being performed on behalf of users or the theft of sensitive session information.

Technologies: [Apache Tomcat](https://junglewise.ai/threats/technologies/tomcat), [org.apache.tomcat:tomcat (Maven)](https://junglewise.ai/threats/technologies/org-apache-tomcat-tomcat), [org.apache.tomcat:tomcat-jasper (Maven)](https://junglewise.ai/threats/technologies/org-apache-tomcat-tomcat-jasper). Vendors: [Apache](https://junglewise.ai/threats/vendors/apache), [Maven](https://junglewise.ai/threats/vendors/maven).

## Quick answers

**Is CVE-2024-52318 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-52318 being exploited in the wild.

**How severe is CVE-2024-52318?** Medium severity, with a CVSS score of 6.1, published 18 November 2024.

**Which products and versions are affected?** Apache Tomcat 11.0.0, 10.1.31, 9.0.96; org.apache.tomcat:tomcat (Maven) ECOSYSTEM:introduced=11.0.0,fixed=11.0.1; org.apache.tomcat:tomcat-jasper (Maven) ECOSYSTEM:introduced=11.0.0,fixed=11.0.1; org.apache.tomcat.embed:tomcat-embed-jasper (Maven) ECOSYSTEM:introduced=9.0.96,fixed=9.0.97.

**Is there a fix for CVE-2024-52318?** Yes. org.apache.tomcat:tomcat (Maven): upgrade to 11.0.1 or later; org.apache.tomcat:tomcat-jasper (Maven): upgrade to 11.0.1 or later; org.apache.tomcat.embed:tomcat-embed-jasper (Maven): upgrade to 9.0.97 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-52318 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2024-52318?** Check whether you run Apache Tomcat, org.apache.tomcat:tomcat (Maven), org.apache.tomcat:tomcat-jasper (Maven) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- org.apache.tomcat:tomcat (Maven): upgrade to 11.0.1 or later

  ```sh
  # set org.apache.tomcat:tomcat to 11.0.1 in your pom.xml or build.gradle
  ```

- org.apache.tomcat:tomcat-jasper (Maven): upgrade to 11.0.1 or later

  ```sh
  # set org.apache.tomcat:tomcat-jasper to 11.0.1 in your pom.xml or build.gradle
  ```

- org.apache.tomcat.embed:tomcat-embed-jasper (Maven): upgrade to 9.0.97 or later

  ```sh
  # set org.apache.tomcat.embed:tomcat-embed-jasper to 9.0.97 in your pom.xml or build.gradle
  ```


## Technical details

A regression introduced in a previous improvement caused pooled JSP tags not to be released after use. This failure in the tag lifecycle management results in subsequent tag outputs not being escaped as expected. An attacker can exploit this behavior to perform a Cross-Site Scripting (XSS) attack by injecting malicious content that the server fails to sanitize. The vulnerability affects Apache Tomcat versions 11.0.0, 10.1.31, and 9.0.96. Users should upgrade to versions 11.0.1, 10.1.33, or 9.0.97 to resolve the issue.

## Affected products

- Apache Tomcat 11.0.0, 10.1.31, 9.0.96

## Identifiers

- CVE-2024-52318
- GHSA-f632-9449-3j4w

## Timeline

- 2024-11-18: disclosed
- 2024-11-18: advisory

## References

- [https://api.github.com/users/aruneko](https://api.github.com/users/aruneko)
- [https://github.com/aruneko](https://github.com/aruneko)
- [https://api.github.com/users/aruneko/gists%7B/gist_id%7D](https://api.github.com/users/aruneko/gists%7B/gist_id%7D)
- [https://api.github.com/users/aruneko/repos](https://api.github.com/users/aruneko/repos)
- [https://avatars.githubusercontent.com/u/2957726?v=4](https://avatars.githubusercontent.com/u/2957726?v=4)
- [https://api.github.com/users/aruneko/events%7B/privacy%7D](https://api.github.com/users/aruneko/events%7B/privacy%7D)

## Related threats

- [Apache Tomcat Jakarta Security credential handler bypass](https://junglewise.ai/threats/cve-2026-111248-the-jakarta-security-identity-store-backed-by-the-tomcat-user)
- [Apache Tomcat incomplete cleanup in TLS 1.3 connections](https://junglewise.ai/threats/cve-2026-93446-incomplete-cleanup-vulnerability-in-apache-tomcat-could-cause-tls)
- [Apache Tomcat HTTP trailer information leak between requests](https://junglewise.ai/threats/cve-2026-88041-incomplete-cleanup-vulnerability-in-apache-tomcat-allowed-an)
- [Apache Tomcat TOCTOU race condition in APR/Native connector](https://junglewise.ai/threats/cve-2026-80353-time-of-check-time-of-use-toctou-race-condition-vulnerability-in)
- [Apache Tomcat Execution After Redirect vulnerability](https://junglewise.ai/threats/cve-2026-74049-execution-after-redirect-ear-vulnerability-in-apache-tomcat-this)
