CVE-2008-6505: Struts2 core Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-wv7g-xhvw-8hcp
CWE-22
Published
Advisory Summary

CVE-2008-6505 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Struts2 core libraries in the Maven ecosystem. The issue involves apache struts directory traversal vulnerability. Remediation is available by upgrading affected packages to version 2.0.12, 2.1.3.

CVE-2008-6505 at a Glance

CVE Identifier CVE-2008-6505
GHSA Identifier GHSA-wv7g-xhvw-8hcp
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 Struts2 core
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2008-6505

To remediate this vulnerability, upgrade all affected Struts2 core 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.struts:struts2-core fixed: 2.0.12
<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <version>2.0.12</version>
</dependency>
org.apache.struts:struts2-core fixed: 2.1.3
<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <version>2.1.3</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.struts

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.apache.struts 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 Struts2 core, 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

Multiple directory traversal vulnerabilities in Apache Struts 2.0.x before 2.0.12 and 2.1.x before 2.1.3 allow remote attackers to read arbitrary files via a `..%252f` (encoded dot dot slash) in a URI with a /struts/ path, related to (1) FilterDispatcher in 2.0.x and (2) DefaultStaticContentLoader in 2.1.x.

CVE-2008-6505 Affected Struts2 core Versions

2 component(s)
Fixed Versions:
2.0.122.1.3
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.struts:struts2-core
Maven
≥ 2.0.0
< 2.0.12
2.0.12
org.apache.struts:struts2-core
Maven
≥ 2.1.0
< 2.1.3
2.1.3

References

Frequently Asked Questions

What is CVE-2008-6505?
CVE-2008-6505 is a security vulnerability in Struts2 core involving Apache Struts directory traversal vulnerability under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Struts2 core versions are affected?
Affected versions include releases prior to 2.0.12, 2.1.3 across affected packages: org.apache.struts:struts2-core.
What version fixes CVE-2008-6505?
Upgrading to 2.0.12, 2.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is struts2-core affected?
Yes, org.apache.struts:struts2-core is affected in releases prior to 2.0.12, 2.1.3. Upgrade your dependency to 2.0.12, 2.1.3 or later.
What CWE is associated with CVE-2008-6505?
CVE-2008-6505 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-6505?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.struts'. 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-wv7g-xhvw-8hcp",
  "modified" : "2024-02-09T19:12:25Z",
  "published" : "2022-05-17T05:52:21Z",
  "aliases" : [ "CVE-2008-6505" ],
  "summary" : "Apache Struts directory traversal vulnerability",
  "details" : "Multiple directory traversal vulnerabilities in Apache Struts 2.0.x before 2.0.12 and 2.1.x before 2.1.3 allow remote attackers to read arbitrary files via a `..%252f` (encoded dot dot slash) in a URI with a /struts/ path, related to (1) FilterDispatcher in 2.0.x and (2) DefaultStaticContentLoader in 2.1.x.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.struts:struts2-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.struts:struts2-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2008-6505"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/struts/commit/04fcefa44bae1263c7cad6986a9dafed67f0164f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/struts/commit/1f1c996eb1f0f3e2193fba0075f62ccd04e3c0c3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/struts"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20081208214512/http://secunia.com/advisories/32497"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20111025094319/http://www.securityfocus.com/bid/32104"
  }, {
    "type" : "WEB",
    "url" : "http://issues.apache.org/struts/browse/WW-2779"
  }, {
    "type" : "WEB",
    "url" : "http://struts.apache.org/2.x/docs/s2-004.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-09T19:12:25Z",
    "nvd_published_at" : "2009-03-23T14:19:00Z"
  }
}