CVE-2008-2938
Description
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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.apache.tomcat:tomcatMaven | >= 4.1.0, < 4.1.39 | 4.1.39 |
org.apache.tomcat:tomcatMaven | >= 5.5.0, < 5.5.27 | 5.5.27 |
org.apache.tomcat:tomcatMaven | >= 6.0.0, < 6.0.18 | 6.0.18 |
Affected products
1Patches
1c55ad56ed72ePort http://svn.apache.org/viewvc?rev=678137&view=rev (additional normalization check) to trunk
1 file changed · +67 −0
java/org/apache/catalina/connector/CoyoteAdapter.java+67 −0 modified@@ -411,6 +411,12 @@ protected boolean postParseRequest(org.apache.coyote.Request req, } // Character decoding convertURI(decodedURI, request); + // Check that the URI is still normalized + if (!checkNormalize(req.decodedURI())) { + res.setStatus(400); + res.setMessage("Invalid URI character encoding"); + return false; + } } else { // The URL is chars or String, and has been sent using an in-memory // protocol handler, we have to assume the URL has been properly @@ -787,6 +793,67 @@ public static boolean normalize(MessageBytes uriMB) { } + /** + * Check that the URI is normalized following character decoding. + * <p> + * This method checks for "\", 0, "//", "/./" and "/../". This method will + * return false if sequences that are supposed to be normalized are still + * present in the URI. + * + * @param uriMB URI to be checked (should be chars) + */ + public static boolean checkNormalize(MessageBytes uriMB) { + + CharChunk uriCC = uriMB.getCharChunk(); + char[] c = uriCC.getChars(); + int start = uriCC.getStart(); + int end = uriCC.getEnd(); + + int pos = 0; + + // Check for '\' and 0 + for (pos = start; pos < end; pos++) { + if (c[pos] == '\\') { + return false; + } + if (c[pos] == 0) { + return false; + } + } + + // Check for "//" + for (pos = start; pos < (end - 1); pos++) { + if (c[pos] == '/') { + if (c[pos + 1] == '/') { + return false; + } + } + } + + // Check for ending with "/." or "/.." + if (((end - start) >= 2) && (c[end - 1] == '.')) { + if ((c[end - 2] == '/') + || ((c[end - 2] == '.') + && (c[end - 3] == '/'))) { + return false; + } + } + + // Check for "/./" + if (uriCC.indexOf("/./", 0, 3, 0) >= 0) { + return false; + } + + // Check for "/../" + if (uriCC.indexOf("/../", 0, 4, 0) >= 0) { + return false; + } + + return true; + + } + + // ------------------------------------------------------ Protected Methods
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
70- lists.apple.com/archives/security-announce/2008/Oct/msg00001.htmlnvdMailing ListThird Party Advisory
- lists.opensuse.org/opensuse-security-announce/2008-09/msg00004.htmlnvdThird Party AdvisoryWEB
- lists.opensuse.org/opensuse-security-announce/2009-02/msg00002.htmlnvdThird Party AdvisoryWEB
- marc.infonvdThird Party Advisory
- securityreason.com/securityalert/4148nvdThird Party Advisory
- support.apple.com/kb/HT3216nvdThird Party AdvisoryWEB
- support.avaya.com/elmodocs2/security/ASA-2008-401.htmnvdThird Party AdvisoryWEB
- tomcat.apache.org/security-4.htmlnvdVendor AdvisoryWEB
- tomcat.apache.org/security-5.htmlnvdVendor AdvisoryWEB
- tomcat.apache.org/security-6.htmlnvdVendor AdvisoryWEB
- www.kb.cert.org/vuls/id/343355nvdThird Party AdvisoryUS Government ResourceWEB
- www.mandriva.com/security/advisoriesnvdThird Party AdvisoryWEB
- www.redhat.com/support/errata/RHSA-2008-0648.htmlnvdThird Party Advisory
- www.redhat.com/support/errata/RHSA-2008-0862.htmlnvdThird Party Advisory
- www.redhat.com/support/errata/RHSA-2008-0864.htmlnvdThird Party Advisory
- www.securenetwork.it/ricerca/advisory/download/SN-2009-02.txtnvdThird Party Advisory
- www.securityfocus.com/archive/1/495318/100/0/threadednvdThird Party AdvisoryVDB Entry
- www.securityfocus.com/archive/1/507729/100/0/threadednvdThird Party AdvisoryVDB Entry
- www.securityfocus.com/bid/30633nvdThird Party AdvisoryVDB Entry
- www.securityfocus.com/bid/31681nvdThird Party AdvisoryVDB Entry
- www.securitytracker.com/idnvdThird Party AdvisoryVDB Entry
- www.vupen.com/english/advisories/2008/2343nvdThird Party Advisory
- www.vupen.com/english/advisories/2008/2780nvdThird Party Advisory
- www.vupen.com/english/advisories/2008/2823nvdThird Party Advisory
- www.vupen.com/english/advisories/2009/0320nvdThird Party Advisory
- exchange.xforce.ibmcloud.com/vulnerabilities/44411nvdThird Party AdvisoryVDB EntryWEB
- github.com/advisories/GHSA-m7xj-ccqc-p4g2ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2008-2938ghsaADVISORY
- www.exploit-db.com/exploits/6229nvdThird Party AdvisoryVDB EntryWEB
- www.redhat.com/archives/fedora-package-announce/2008-September/msg00712.htmlnvdThird Party AdvisoryWEB
- www.redhat.com/archives/fedora-package-announce/2008-September/msg00859.htmlnvdThird Party AdvisoryWEB
- www.redhat.com/archives/fedora-package-announce/2008-September/msg00889.htmlnvdThird Party AdvisoryWEB
- secunia.com/advisories/31639nvdBroken Link
- secunia.com/advisories/31865nvdBroken Link
- secunia.com/advisories/31891nvdBroken Link
- secunia.com/advisories/31982nvdBroken Link
- secunia.com/advisories/32120nvdBroken Link
- secunia.com/advisories/32222nvdBroken Link
- secunia.com/advisories/32266nvdBroken Link
- secunia.com/advisories/33797nvdBroken Link
- secunia.com/advisories/37297nvdBroken Link
- github.com/apache/tomcat/commit/c55ad56ed72ee1dbfe790bc5492d4df74e3e754fghsaWEB
- lists.apache.org/thread.html/29dc6c2b625789e70a9c4756b5a327e6547273ff8bde7e0327af48c5%40%3Cdev.tomcat.apache.org%3EnvdWEB
- lists.apache.org/thread.html/29dc6c2b625789e70a9c4756b5a327e6547273ff8bde7e0327af48c5@%3Cdev.tomcat.apache.org%3EghsaWEB
- lists.apache.org/thread.html/c62b0e3a7bf23342352a5810c640a94b6db69957c5c19db507004d74%40%3Cdev.tomcat.apache.org%3EnvdWEB
- lists.apache.org/thread.html/c62b0e3a7bf23342352a5810c640a94b6db69957c5c19db507004d74@%3Cdev.tomcat.apache.org%3EghsaWEB
- lists.apache.org/thread.html/rb71997f506c6cc8b530dd845c084995a9878098846c7b4eacfae8db3%40%3Cdev.tomcat.apache.org%3EnvdWEB
- lists.apache.org/thread.html/rb71997f506c6cc8b530dd845c084995a9878098846c7b4eacfae8db3@%3Cdev.tomcat.apache.org%3EghsaWEB
- lists.apple.com/archives/security-announce/2008/Oct/msg00001.htmlghsaWEB
- oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10587nvdTool SignatureWEB
- web.archive.org/web/20080827130946/http://securityreason.com/securityalert/4148ghsaWEB
- web.archive.org/web/20090201124623/http://secunia.com/advisories/31639ghsaWEB
- web.archive.org/web/20090201124633/http://secunia.com/advisories/31891ghsaWEB
- web.archive.org/web/20090201124638/http://secunia.com/advisories/32120ghsaWEB
- web.archive.org/web/20090201124957/http://secunia.com/advisories/31982ghsaWEB
- web.archive.org/web/20090201125002/http://secunia.com/advisories/32266ghsaWEB
- web.archive.org/web/20090201141000/http://secunia.com/advisories/32222ghsaWEB
- web.archive.org/web/20090207111236/http://secunia.com/advisories/33797ghsaWEB
- web.archive.org/web/20090308065055/http://secunia.com/advisories/31865ghsaWEB
- web.archive.org/web/20100516085845/http://secunia.com/advisories/37297ghsaWEB
- web.archive.org/web/20110711210039/http://rhn.redhat.com/errata/RHSA-2008-0862.htmlghsaWEB
- web.archive.org/web/20110713233239/http://rhn.redhat.com/errata/RHSA-2008-0648.htmlghsaWEB
- web.archive.org/web/20110713234158/http://rhn.redhat.com/errata/RHSA-2008-0864.htmlghsaWEB
- web.archive.org/web/20140628064423/http://www.securityfocus.com/archive/1/495318/100/0/threadedghsaWEB
- web.archive.org/web/20140628064448/http://www.securityfocus.com/archive/1/507729/100/0/threadedghsaWEB
- web.archive.org/web/20140826163457/http://www.securityfocus.com/bid/30633ghsaWEB
- web.archive.org/web/20140826171227/http://www.securitytracker.com/idghsaWEB
- web.archive.org/web/20140826232500/http://www.securityfocus.com/bid/31681ghsaWEB
- web.archive.org/web/20140827130327/http://www.securenetwork.it/ricerca/advisory/download/SN-2009-02.txtghsaWEB
- web.archive.org/web/20200612070417/http://marc.info/ghsaWEB
News mentions
0No linked articles in our index yet.