CVE-2024-52318: Apache Tomcat Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-f632-9449-3j4w
CVSS 6.1
CWE-326
Published
Advisory Summary

CVE-2024-52318 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-326: Inadequate Encryption Strength) affecting Apache Tomcat libraries in the Maven ecosystem. The issue involves apache tomcat - xss in generated jsps. Remediation is available by upgrading affected packages to version 11.0.1, 10.1.32, 9.0.97.

CVE-2024-52318 at a Glance

CVE Identifier CVE-2024-52318
GHSA Identifier GHSA-f632-9449-3j4w
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-326: Inadequate Encryption Strength
Affected Product Apache Tomcat
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-52318

To remediate this vulnerability, upgrade all affected Apache Tomcat dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.tomcat:tomcat-jasper fixed: 11.0.1
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-jasper</artifactId>
    <version>11.0.1</version>
</dependency>
org.apache.tomcat:tomcat-jasper fixed: 10.1.32
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-jasper</artifactId>
    <version>10.1.32</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-jasper fixed: 9.0.97
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
    <version>9.0.97</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-jasper fixed: 11.0.1
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
    <version>11.0.1</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-jasper fixed: 10.1.32
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
    <version>10.1.32</version>
</dependency>
org.apache.tomcat:tomcat-jasper fixed: 9.0.97
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-jasper</artifactId>
    <version>9.0.97</version>
</dependency>
org.apache.tomcat:tomcat fixed: 11.0.1
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>11.0.1</version>
</dependency>
org.apache.tomcat:tomcat fixed: 10.1.32
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>10.1.32</version>
</dependency>
org.apache.tomcat:tomcat fixed: 9.0.97
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>9.0.97</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.tomcat

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-52318, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.tomcat

Analyze the terminal output to locate any version of Apache Tomcat in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.0.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.tomcat command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-326: Inadequate Encryption Strength, where the product stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required. In Apache Tomcat, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Description: The fix for improvement 69333 caused pooled JSP tags not to be released after use which in turn could cause output of some tags not to escaped as expected. This unescaped output could lead to XSS. # Versions Affected: - Apache Tomcat 11.0.0 - Apache Tomcat 10.1.31 - Apache Tomcat 9.0.96 # Mitigation: Users of the affected versions should apply one of the following mitigations: - Upgrade to Apache Tomcat 11.0.1 or later - Upgrade to Apache Tomcat 10.1.33 or later Note: 10.1.32 was not released - Upgrade to Apache Tomcat 9.0.97 or later

CVE-2024-52318 Affected Apache Tomcat Versions

9 component(s)
Fixed Versions:
11.0.110.1.329.0.97
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.tomcat:tomcat-jasper
Maven
≥ 11.0.0
< 11.0.1
All 1 versions
11.0.0
11.0.1
org.apache.tomcat:tomcat-jasper
Maven
≥ 10.1.31
< 10.1.32
All 1 versions
10.1.31
10.1.32
org.apache.tomcat.embed:tomcat-embed-jasper
Maven
≥ 9.0.96
< 9.0.97
All 1 versions
9.0.96
9.0.97
org.apache.tomcat.embed:tomcat-embed-jasper
Maven
≥ 11.0.0
< 11.0.1
All 1 versions
11.0.0
11.0.1
org.apache.tomcat.embed:tomcat-embed-jasper
Maven
≥ 10.1.31
< 10.1.32
All 1 versions
10.1.31
10.1.32
org.apache.tomcat:tomcat-jasper
Maven
≥ 9.0.96
< 9.0.97
All 1 versions
9.0.96
9.0.97
org.apache.tomcat:tomcat
Maven
≥ 11.0.0
< 11.0.1
All 1 versions
11.0.0
11.0.1
org.apache.tomcat:tomcat
Maven
≥ 10.1.31
< 10.1.32
All 1 versions
10.1.31
10.1.32
org.apache.tomcat:tomcat
Maven
≥ 9.0.96
< 9.0.97
All 1 versions
9.0.96
9.0.97

References

Frequently Asked Questions

What is CVE-2024-52318?
CVE-2024-52318 is a security vulnerability in Apache Tomcat involving Apache Tomcat - XSS in generated JSPs under CWE-326: Inadequate Encryption Strength.
Which Apache Tomcat versions are affected?
Affected versions include releases prior to 11.0.1, 10.1.32, 9.0.97 across affected packages: org.apache.tomcat:tomcat-jasper, org.apache.tomcat.embed:tomcat-embed-jasper, org.apache.tomcat:tomcat.
What version fixes CVE-2024-52318?
Upgrading to 11.0.1, 10.1.32, 9.0.97 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tomcat-jasper affected?
Yes, org.apache.tomcat:tomcat-jasper is affected in releases prior to 11.0.1, 10.1.32, 9.0.97. Upgrade your dependency to 11.0.1, 10.1.32, 9.0.97 or later.
Is tomcat-embed-jasper affected?
Yes, org.apache.tomcat.embed:tomcat-embed-jasper is affected in releases prior to 9.0.97, 11.0.1, 10.1.32. Upgrade your dependency to 9.0.97, 11.0.1, 10.1.32 or later.
What is the CVSS score of CVE-2024-52318?
CVE-2024-52318 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2024-52318?
CVE-2024-52318 is classified under CWE-326: Inadequate Encryption Strength (The product stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.).
How can I check Maven dependencies for CVE-2024-52318?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.tomcat'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f632-9449-3j4w",
  "modified" : "2026-06-18T20:22:52Z",
  "published" : "2024-11-18T15:33:20Z",
  "aliases" : [ "CVE-2024-52318" ],
  "summary" : "Apache Tomcat - XSS in generated JSPs",
  "details" : "# Description:\nThe fix for improvement 69333 caused pooled JSP tags not to be released after use which in turn could cause output of some tags not to escaped as expected. This unescaped output could lead to XSS.\n\n# Versions Affected:\n- Apache Tomcat 11.0.0\n- Apache Tomcat 10.1.31\n- Apache Tomcat 9.0.96\n\n# Mitigation:\nUsers of the affected versions should apply one of the following\nmitigations:\n- Upgrade to Apache Tomcat 11.0.1 or later\n- Upgrade to Apache Tomcat 10.1.33 or later\nNote: 10.1.32 was not released\n- Upgrade to Apache Tomcat 9.0.97 or later",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-jasper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0"
      }, {
        "fixed" : "11.0.1"
      } ]
    } ],
    "versions" : [ "11.0.0" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-jasper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.31"
      }, {
        "fixed" : "10.1.32"
      } ]
    } ],
    "versions" : [ "10.1.31" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-jasper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.96"
      }, {
        "fixed" : "9.0.97"
      } ]
    } ],
    "versions" : [ "9.0.96" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-jasper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0"
      }, {
        "fixed" : "11.0.1"
      } ]
    } ],
    "versions" : [ "11.0.0" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-jasper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.31"
      }, {
        "fixed" : "10.1.32"
      } ]
    } ],
    "versions" : [ "10.1.31" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-jasper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.96"
      }, {
        "fixed" : "9.0.97"
      } ]
    } ],
    "versions" : [ "9.0.96" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0"
      }, {
        "fixed" : "11.0.1"
      } ]
    } ],
    "versions" : [ "11.0.0" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.31"
      }, {
        "fixed" : "10.1.32"
      } ]
    } ],
    "versions" : [ "10.1.31" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.96"
      }, {
        "fixed" : "9.0.97"
      } ]
    } ],
    "versions" : [ "9.0.96" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52318"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/8d1fc4733a06d1a03b9d644c57010f2ec5f0df38"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/9813c5dd3259183f659bbb83312a5cf673cc1ebf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/be8e32143a3159e78fe5463d09bb8e1b33bf2b1f"
  }, {
    "type" : "WEB",
    "url" : "https://bz.apache.org/bugzilla/show_bug.cgi?id=69333"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/tomcat"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/co243cw1nlh6p521c5265cm839wkqdp9"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20250131-0009"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2024/11/18/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-326" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-18T21:03:24Z",
    "nvd_published_at" : "2024-11-18T13:15:04Z"
  }
}