CVE-2026-107844: Contao Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-mrvp-7wmx-5m4h
CVSS 5.3
CWE-22
Published
Advisory Summary

CVE-2026-107844 is a MODERATE (CVSS 5.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Contao libraries in the Packagist ecosystem. The issue involves path traversal in the images controller. Remediation is available by upgrading affected packages to version 5.3.50, 5.7.12.

CVE-2026-107844 at a Glance

CVE Identifier CVE-2026-107844
GHSA Identifier GHSA-mrvp-7wmx-5m4h
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Contao
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:N/S:U/C:L/I:N/A:N).

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

How to Fix CVE-2026-107844

To remediate this vulnerability, upgrade all affected 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/core-bundle fixed: 5.3.50
Upgrade contao/core-bundle to 5.3.50
contao/core-bundle fixed: 5.7.12
Upgrade contao/core-bundle to 5.7.12
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/core-bundle

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-107844, inspect your project dependencies for Contao:

inspect dependencies for contao/core-bundle

Analyze the terminal output to locate any version of Contao in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.3.50), 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, 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

`ImagesController` joins the user controlled `{path}` onto the configured image target directory with `Path::join()`, which canonicalises `..` segments, and never calls `Path::isBasePath()` to confirm the result stayed inside that directory. An unauthenticated GET with percent encoded dot segments therefore escapes the directory and the file is returned by `BinaryFileResponse`. Reads are bounded to the extensions in `contao.image.valid_extensions`, and paths below the upload directory fail for an unrelated reason, so this is reported as a missing boundary check rather than as a general arbitrary file read. Both Apache with the shipped `public/.htaccess` and nginx with the documented configuration are affected. ### Impact Any unauthenticated visitor can read files that are deliberately kept outside the document root, anywhere under the project directory, as long as the name ends in one of `contao.image.valid_extensions` (`jpg`, `jpeg`, `gif`, `png`, `tif`, `tiff`, `bmp`, `svg`, `svgz`, `webp`). The route also acts as an existence oracle for arbitrary paths, and on a debug enabled instance the 404 message discloses the absolute filesystem path. **Honesty caveat, stated because it lowers the severity.** The reporter could not use this to read protected member folders: every path below the upload directory returns 500 for the reason given under Details, so the practically reachable set is image typed files outside `files/`.

CVE-2026-107844 Affected Contao Versions

2 component(s)
Fixed Versions:
5.3.505.7.12
Product / Package Ecosystem Affected Versions Fixed Version
contao/core-bundle
Packagist
≥ 4.1.0
< 5.3.50
5.3.50
contao/core-bundle
Packagist
≥ 5.4.0-RC1
< 5.7.12
5.7.12

References

Frequently Asked Questions

What is CVE-2026-107844?
CVE-2026-107844 is a security vulnerability in Contao involving Path traversal in the images controller under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Contao versions are affected?
Affected versions include releases prior to 5.3.50, 5.7.12 across affected packages: contao/core-bundle.
What version fixes CVE-2026-107844?
Upgrading to 5.3.50, 5.7.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is contao/core-bundle affected?
Yes, contao/core-bundle is affected in releases prior to 5.3.50, 5.7.12. Upgrade your dependency to 5.3.50, 5.7.12 or later.
What is the CVSS score of CVE-2026-107844?
CVE-2026-107844 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-107844?
CVE-2026-107844 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-2026-107844?
Run the dependency tree command: 'inspect dependencies for contao/core-bundle'. 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-mrvp-7wmx-5m4h",
  "modified" : "2026-10-09T20:53:55Z",
  "published" : "2026-10-09T20:53:55Z",
  "aliases" : [ "CVE-2026-107844" ],
  "summary" : "Contao: Path traversal in the images controller",
  "details" : "`ImagesController` joins the user controlled `{path}` onto the configured image target directory with `Path::join()`, which canonicalises `..` segments, and never calls `Path::isBasePath()` to confirm the result stayed inside that directory. An unauthenticated GET with percent encoded dot segments therefore escapes the directory and the file is returned by `BinaryFileResponse`. Reads are bounded to the extensions in `contao.image.valid_extensions`, and paths below the upload directory fail for an unrelated reason, so this is reported as a missing boundary check rather than as a general arbitrary file read. Both Apache with the shipped `public/.htaccess` and nginx with the documented configuration are affected.\n\n### Impact\n\nAny unauthenticated visitor can read files that are deliberately kept outside the document root, anywhere under the project directory, as long as the name ends in one of `contao.image.valid_extensions` (`jpg`, `jpeg`, `gif`, `png`, `tif`, `tiff`, `bmp`, `svg`, `svgz`, `webp`). The route also acts as an existence oracle for arbitrary paths, and on a debug enabled instance the 404 message discloses the absolute filesystem path.\n\n**Honesty caveat, stated because it lowers the severity.** The reporter could not use this to read protected member folders: every path below the upload directory returns 500 for the reason given under Details, so the practically reachable set is image typed files outside `files/`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/core-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "5.3.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/core-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.4.0-RC1"
      }, {
        "fixed" : "5.7.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/security/advisories/GHSA-mrvp-7wmx-5m4h"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/commit/867c055122fdf12220f973f862082037b695b9bd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/contao/contao"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/releases/tag/5.3.50"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/releases/tag/5.7.12"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-09T20:53:55Z",
    "nvd_published_at" : null
  }
}