CVE-2023-29200: Contao/contao Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-fp7q-xhhw-6rj3
CVSS 8.8
CWE-22
Published
Advisory Summary

CVE-2023-29200 is a HIGH (CVSS 8.8) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Contao/contao libraries in the Packagist ecosystem. The issue involves path traversal vulnerability in the file manager. Remediation is available by upgrading affected packages to version 4.9.40, 4.13.21, 5.1.4.

CVE-2023-29200 at a Glance

CVE Identifier CVE-2023-29200
GHSA Identifier GHSA-fp7q-xhhw-6rj3
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Contao/contao
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

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

How to Fix CVE-2023-29200

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

contao/contao fixed: 4.9.40
Upgrade contao/contao to 4.9.40
contao/contao fixed: 4.13.21
Upgrade contao/contao to 4.13.21
contao/contao fixed: 5.1.4
Upgrade contao/contao to 5.1.4
Verify Direct and Transitive Dependencies

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

inspect dependencies for contao/contao

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-29200, inspect your project dependencies for Contao/contao:

inspect dependencies for contao/contao

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

Note: Verify declared build manifests and deployed runtime container environments.

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 Contao/contao, 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

### Impact Authenticated users in the back end can list files outside the document root in the file manager. ### Patches Update to Contao 4.9.40, 4.13.21 or 5.1.4. ### Workarounds None. ### References https://contao.org/en/security-advisories/directory-traversal-in-the-file-manager ### For more information If you have any questions or comments about this advisory, open an issue in [contao/contao](https://github.com/contao/contao/issues/new/choose).

CVE-2023-29200 Affected Contao/contao Versions

3 component(s)
Fixed Versions:
4.9.404.13.215.1.4
Product / Package Ecosystem Affected Versions Fixed Version
contao/contao
Packagist
≥ 4.9.0
< 4.9.40
4.9.40
contao/contao
Packagist
≥ 4.13.0
< 4.13.21
4.13.21
contao/contao
Packagist
≥ 5.1.0
< 5.1.4
5.1.4

References

Frequently Asked Questions

What is CVE-2023-29200?
CVE-2023-29200 is a security vulnerability in Contao/contao involving Path traversal vulnerability in the file manager under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Contao/contao versions are affected?
Affected versions include releases prior to 4.9.40, 4.13.21, 5.1.4 across affected packages: contao/contao.
What version fixes CVE-2023-29200?
Upgrading to 4.9.40, 4.13.21, 5.1.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is contao/contao affected?
Yes, contao/contao is affected in releases prior to 4.9.40, 4.13.21, 5.1.4. Upgrade your dependency to 4.9.40, 4.13.21, 5.1.4 or later.
What is the CVSS score of CVE-2023-29200?
CVE-2023-29200 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-29200?
CVE-2023-29200 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 Packagist dependencies for CVE-2023-29200?
Run the dependency tree command: 'inspect dependencies for contao/contao'. 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-fp7q-xhhw-6rj3",
  "modified" : "2023-04-26T16:05:02Z",
  "published" : "2023-04-26T16:05:02Z",
  "aliases" : [ "CVE-2023-29200" ],
  "summary" : "Path traversal vulnerability in the file manager",
  "details" : "### Impact\n\nAuthenticated users in the back end can list files outside the document root in the file manager.\n\n### Patches\n\nUpdate to Contao 4.9.40, 4.13.21 or 5.1.4.\n\n### Workarounds\n\nNone.\n\n### References\n\nhttps://contao.org/en/security-advisories/directory-traversal-in-the-file-manager\n\n### For more information\n\nIf you have any questions or comments about this advisory, open an issue in [contao/contao](https://github.com/contao/contao/issues/new/choose).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/contao"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.9.0"
      }, {
        "fixed" : "4.9.40"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/contao"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.13.0"
      }, {
        "fixed" : "4.13.21"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/contao"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.1.0"
      }, {
        "fixed" : "5.1.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/security/advisories/GHSA-fp7q-xhhw-6rj3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-29200"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/commit/6f3e705f4ff23f4419563d09d8485793569f31df"
  }, {
    "type" : "WEB",
    "url" : "https://contao.org/en/security-advisories/directory-traversal-in-the-file-manager"
  }, {
    "type" : "WEB",
    "url" : "https://contao.org/en/security-advisories/directory-traversal-in-the-file-manager.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/contao/contao/CVE-2023-29200.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/contao/contao"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-26T16:05:02Z",
    "nvd_published_at" : "2023-04-25T18:15:09Z"
  }
}