CVE-2008-2938: Apache Tomcat Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-m7xj-ccqc-p4g2
CWE-22
Published
Advisory Summary

CVE-2008-2938 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Apache Tomcat libraries in the Maven ecosystem. The issue involves apache tomcat directory traversal vulnerability. Remediation is available by upgrading affected packages to version 4.1.39, 5.5.27, 6.0.18.

CVE-2008-2938 at a Glance

CVE Identifier CVE-2008-2938
GHSA Identifier GHSA-m7xj-ccqc-p4g2
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Apache Tomcat
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2008-2938

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 fixed: 4.1.39
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>4.1.39</version>
</dependency>
org.apache.tomcat:tomcat fixed: 5.5.27
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>5.5.27</version>
</dependency>
org.apache.tomcat:tomcat fixed: 6.0.18
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>6.0.18</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-2008-2938, 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 4.1.39), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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

Directory traversal vulnerability in Apache Tomcat 4.1.0 through 4.1.37, 5.5.0 through 5.5.26, and 6.0.0 through 6.0.16, when allowLinking and UTF-8 are enabled, allows remote attackers to read arbitrary files via encoded directory traversal sequences in the URI, a different vulnerability than CVE-2008-2370. NOTE: versions earlier than 6.0.18 were reported affected, but the vendor advisory lists 6.0.16 as the last affected version.

CVE-2008-2938 Affected Apache Tomcat Versions

3 component(s)
Fixed Versions:
4.1.395.5.276.0.18
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.tomcat:tomcat
Maven
≥ 4.1.0
< 4.1.39
4.1.39
org.apache.tomcat:tomcat
Maven
≥ 5.5.0
< 5.5.27
5.5.27
org.apache.tomcat:tomcat
Maven
≥ 6.0.0
< 6.0.18
6.0.18

References

NVD — CVE-2008-2938 NVD
https://nvd.nist.gov/vuln/detail/CVE-2008-2938
Security Fix Commit FIX COMMIT
https://github.com/apache/tomcat/commit/c55ad56ed72ee1dbfe790bc5492d4df74e3e754f
web.archive.org/web/20090207111236/... WEB
https://web.archive.org/web/20090207111236/http://secunia.com/advisories/33797
web.archive.org/web/20090308065055/... WEB
https://web.archive.org/web/20090308065055/http://secunia.com/advisories/31865
support.apple.com/kb/ht3216 WEB
http://support.apple.com/kb/HT3216
web.archive.org/web/20100516085845/... WEB
https://web.archive.org/web/20100516085845/http://secunia.com/advisories/37297
web.archive.org/web/20110711210039/... WEB
https://web.archive.org/web/20110711210039/http://rhn.redhat.com/errata/RHSA-2008-0862.html
web.archive.org/web/20110713233239/... WEB
https://web.archive.org/web/20110713233239/http://rhn.redhat.com/errata/RHSA-2008-0648.html
web.archive.org/web/20110713234158/... WEB
https://web.archive.org/web/20110713234158/http://rhn.redhat.com/errata/RHSA-2008-0864.html
Apache Tomcat Security Information SECURITY
https://web.archive.org/web/20140628064423/http://www.securityfocus.com/archive/1/495318/100/0/threaded
Apache Tomcat Security Information SECURITY
https://web.archive.org/web/20140628064448/http://www.securityfocus.com/archive/1/507729/100/0/threaded
Apache Tomcat Security Information SECURITY
https://web.archive.org/web/20140826163457/http://www.securityfocus.com/bid/30633
Apache Tomcat Security Information SECURITY
https://web.archive.org/web/20140826171227/http://www.securitytracker.com/id?1020665
Apache Tomcat Security Information SECURITY
https://web.archive.org/web/20140826232500/http://www.securityfocus.com/bid/31681
web.archive.org/web/20140827130327/... WEB
https://web.archive.org/web/20140827130327/http://www.securenetwork.it/ricerca/advisory/download/SN-2009-02.txt
web.archive.org/web/20200612070417/... WEB
https://web.archive.org/web/20200612070417/http://marc.info/?l=bugtraq&m=123376588623823&w=2
www.exploit-db.com/exploits/6229 WEB
https://www.exploit-db.com/exploits/6229
www.redhat.com/archives/fedora-pac... WEB
https://www.redhat.com/archives/fedora-package-announce/2008-September/msg00712.html
www.redhat.com/archives/fedora-pac... WEB
https://www.redhat.com/archives/fedora-package-announce/2008-September/msg00859.html
www.redhat.com/archives/fedora-pac... WEB
https://www.redhat.com/archives/fedora-package-announce/2008-September/msg00889.html
exchange.xforce.ibmcloud.com/vulnerabilities/444... WEB
https://exchange.xforce.ibmcloud.com/vulnerabilities/44411
Apache Tomcat Source Repository REPOSITORY
https://github.com/apache/tomcat
lists.apache.org/thread.html/29dc6c2... WEB
https://lists.apache.org/thread.html/29dc6c2b625789e70a9c4756b5a327e6547273ff8bde7e0327af48c5%40%3Cdev.tomcat.apache.org%3E
lists.apache.org/thread.html/29dc6c2... WEB
https://lists.apache.org/thread.html/29dc6c2b625789e70a9c4756b5a327e6547273ff8bde7e0327af48c5@%3Cdev.tomcat.apache.org%3E
lists.apache.org/thread.html/c62b0e3... WEB
https://lists.apache.org/thread.html/c62b0e3a7bf23342352a5810c640a94b6db69957c5c19db507004d74%40%3Cdev.tomcat.apache.org%3E
lists.apache.org/thread.html/c62b0e3... WEB
https://lists.apache.org/thread.html/c62b0e3a7bf23342352a5810c640a94b6db69957c5c19db507004d74@%3Cdev.tomcat.apache.org%3E
lists.apache.org/thread.html/rb71997... WEB
https://lists.apache.org/thread.html/rb71997f506c6cc8b530dd845c084995a9878098846c7b4eacfae8db3%40%3Cdev.tomcat.apache.org%3E
lists.apache.org/thread.html/rb71997... WEB
https://lists.apache.org/thread.html/rb71997f506c6cc8b530dd845c084995a9878098846c7b4eacfae8db3@%3Cdev.tomcat.apache.org%3E
Apache Tomcat Security Information SECURITY
https://lists.apple.com/archives/security-announce/2008/Oct/msg00001.html
Apache Tomcat Security Information SECURITY
https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10587
Apache Tomcat Security Information SECURITY
https://web.archive.org/web/20080827130946/http://securityreason.com/securityalert/4148
web.archive.org/web/20090201124623/... WEB
https://web.archive.org/web/20090201124623/http://secunia.com/advisories/31639
web.archive.org/web/20090201124633/... WEB
https://web.archive.org/web/20090201124633/http://secunia.com/advisories/31891
web.archive.org/web/20090201124638/... WEB
https://web.archive.org/web/20090201124638/http://secunia.com/advisories/32120
web.archive.org/web/20090201124957/... WEB
https://web.archive.org/web/20090201124957/http://secunia.com/advisories/31982
web.archive.org/web/20090201125002/... WEB
https://web.archive.org/web/20090201125002/http://secunia.com/advisories/32266
web.archive.org/web/20090201141000/... WEB
https://web.archive.org/web/20090201141000/http://secunia.com/advisories/32222
Apache Tomcat Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2008-09/msg00004.html
Apache Tomcat Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2009-02/msg00002.html
Apache Tomcat Security Information SECURITY
http://support.avaya.com/elmodocs2/security/ASA-2008-401.htm
Apache Tomcat Security Information SECURITY
http://tomcat.apache.org/security-4.html
Apache Tomcat Security Information SECURITY
http://tomcat.apache.org/security-5.html
Apache Tomcat Security Information SECURITY
http://tomcat.apache.org/security-6.html
www.kb.cert.org/vuls/id/343355 WEB
http://www.kb.cert.org/vuls/id/343355
Apache Tomcat Security Information SECURITY
http://www.mandriva.com/security/advisories?name=MDVSA-2008:188

Frequently Asked Questions

What is CVE-2008-2938?
CVE-2008-2938 is a security vulnerability in Apache Tomcat involving Apache Tomcat Directory Traversal vulnerability under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Apache Tomcat versions are affected?
Affected versions include releases prior to 4.1.39, 5.5.27, 6.0.18 across affected packages: org.apache.tomcat:tomcat.
What version fixes CVE-2008-2938?
Upgrading to 4.1.39, 5.5.27, 6.0.18 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tomcat affected?
Yes, org.apache.tomcat:tomcat is affected in releases prior to 4.1.39, 5.5.27, 6.0.18. Upgrade your dependency to 4.1.39, 5.5.27, 6.0.18 or later.
What CWE is associated with CVE-2008-2938?
CVE-2008-2938 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Maven dependencies for CVE-2008-2938?
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-m7xj-ccqc-p4g2",
  "modified" : "2024-02-23T18:30:24Z",
  "published" : "2022-05-01T23:55:04Z",
  "aliases" : [ "CVE-2008-2938" ],
  "summary" : "Apache Tomcat Directory Traversal vulnerability",
  "details" : "Directory traversal vulnerability in Apache Tomcat 4.1.0 through 4.1.37, 5.5.0 through 5.5.26, and 6.0.0 through 6.0.16, when allowLinking and UTF-8 are enabled, allows remote attackers to read arbitrary files via encoded directory traversal sequences in the URI, a different vulnerability than CVE-2008-2370.  NOTE: versions earlier than 6.0.18 were reported affected, but the vendor advisory lists 6.0.16 as the last affected version.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.39"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.1.37"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.5.0"
      }, {
        "fixed" : "5.5.27"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.5.26"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.18"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.16"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2008-2938"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/c55ad56ed72ee1dbfe790bc5492d4df74e3e754f"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090207111236/http://secunia.com/advisories/33797"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090308065055/http://secunia.com/advisories/31865"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20100516085845/http://secunia.com/advisories/37297"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20110711210039/http://rhn.redhat.com/errata/RHSA-2008-0862.html"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20110713233239/http://rhn.redhat.com/errata/RHSA-2008-0648.html"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20110713234158/http://rhn.redhat.com/errata/RHSA-2008-0864.html"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20140628064423/http://www.securityfocus.com/archive/1/495318/100/0/threaded"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20140628064448/http://www.securityfocus.com/archive/1/507729/100/0/threaded"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20140826163457/http://www.securityfocus.com/bid/30633"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20140826171227/http://www.securitytracker.com/id?1020665"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20140826232500/http://www.securityfocus.com/bid/31681"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20140827130327/http://www.securenetwork.it/ricerca/advisory/download/SN-2009-02.txt"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200612070417/http://marc.info/?l=bugtraq&m=123376588623823&w=2"
  }, {
    "type" : "WEB",
    "url" : "https://www.exploit-db.com/exploits/6229"
  }, {
    "type" : "WEB",
    "url" : "https://www.redhat.com/archives/fedora-package-announce/2008-September/msg00712.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.redhat.com/archives/fedora-package-announce/2008-September/msg00859.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.redhat.com/archives/fedora-package-announce/2008-September/msg00889.html"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/44411"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/tomcat"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/29dc6c2b625789e70a9c4756b5a327e6547273ff8bde7e0327af48c5%40%3Cdev.tomcat.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/29dc6c2b625789e70a9c4756b5a327e6547273ff8bde7e0327af48c5@%3Cdev.tomcat.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/c62b0e3a7bf23342352a5810c640a94b6db69957c5c19db507004d74%40%3Cdev.tomcat.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/c62b0e3a7bf23342352a5810c640a94b6db69957c5c19db507004d74@%3Cdev.tomcat.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rb71997f506c6cc8b530dd845c084995a9878098846c7b4eacfae8db3%40%3Cdev.tomcat.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rb71997f506c6cc8b530dd845c084995a9878098846c7b4eacfae8db3@%3Cdev.tomcat.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apple.com/archives/security-announce/2008/Oct/msg00001.html"
  }, {
    "type" : "WEB",
    "url" : "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10587"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20080827130946/http://securityreason.com/securityalert/4148"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090201124623/http://secunia.com/advisories/31639"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090201124633/http://secunia.com/advisories/31891"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090201124638/http://secunia.com/advisories/32120"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090201124957/http://secunia.com/advisories/31982"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090201125002/http://secunia.com/advisories/32266"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090201141000/http://secunia.com/advisories/32222"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2008-09/msg00004.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2009-02/msg00002.html"
  }, {
    "type" : "WEB",
    "url" : "http://support.apple.com/kb/HT3216"
  }, {
    "type" : "WEB",
    "url" : "http://support.avaya.com/elmodocs2/security/ASA-2008-401.htm"
  }, {
    "type" : "WEB",
    "url" : "http://tomcat.apache.org/security-4.html"
  }, {
    "type" : "WEB",
    "url" : "http://tomcat.apache.org/security-5.html"
  }, {
    "type" : "WEB",
    "url" : "http://tomcat.apache.org/security-6.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.kb.cert.org/vuls/id/343355"
  }, {
    "type" : "WEB",
    "url" : "http://www.mandriva.com/security/advisories?name=MDVSA-2008:188"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-23T18:30:24Z",
    "nvd_published_at" : "2008-08-13T00:41:00Z"
  }
}