CVE Professor
/
All CVEs
CVE-2026-135803

CVE-2026-135803 — Symfony Symfony/filesystem (5.4.56) — CWE-22

CRITICAL CVSS 9.1 NVD

Most methods of Symfony\Component\Filesystem\Path rely on Path::split(), which takes everything before the first :// as the root of a path. It doesn't check that this prefix is a URI scheme, so the .. segments in that prefix are never resolved. PHP sees a scheme only at the start of a string. So /base/../x://../secret.txt is a plain local path to /secret.txt for PHP, while Path::isBasePath('/base', '/base/../x://../secret.txt') returns true. canonicalize(), join(), makeAbsolute() and makeRelative() are affected the same way. Some applications check a path built from user input with isBasePath() or canonicalize(), and then open it. They can be made to read or write files outside the expected directory. On Symfony 6.4 and later, the AssetMapper component builds with Path::join() the path of the files that a remote package references from its CSS. A malicious or compromised package can therefore make importmap:require or importmap:install write a file of its choice outside assets/vendor. For example, the CSS url(../../../../../public/x://shell.php) writes public/x:/shell.php. A prefix is now a scheme only when PHP would look for a stream wrapper with that name. That is two or more letters, digits, +, - or ., followed by :// at the start of the path. Other prefixes are regular path segments, and the .. segments after them are resolved. Real schemes such as phar://, file://, vfs:// or compress.zlib:// keep working.

Most methods of Symfony\Component\Filesystem\Path rely on Path::split(), which takes everything before the first :// as the root of a path. It doesn't check that this prefix is a URI scheme, so the .. segments in that prefix are never resolved. PHP sees a scheme only at the start of a string. So /base/../x://../secret.txt is a plain local path to /secret.txt for PHP, while Path::isBasePath('/base', '/base/../x://../secret.txt') returns true. canonicalize(), join(), makeAbsolute() and makeRelative() are affected the same way. Some applications check a path built from user input with isBasePath() or canonicalize(), and then open it. They can be made to read or write files outside the expected directory. On Symfony 6.4 and later, the AssetMapper component builds with Path::join() the path of the files that a remote package references from its CSS. A malicious or compromised package can therefore make importmap:require or importmap:install write a file of its choice outside assets/vendor. For example, the CSS url(../../../../../public/x://shell.php) writes public/x:/shell.php. A prefix is now a scheme only when PHP would look for a stream wrapper with that name. That is two or more letters, digits, +, - or ., followed by :// at the start of the path. Other prefixes are regular path segments, and the .. segments after them are resolved. Real schemes such as phar://, file://, vfs:// or compress.zlib:// keep working.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability None A:N
AI Security Analysis & Remediation

🎯 What is this vulnerability?

This vulnerability is a Path Traversal (CWE-22) flaw within the Symfony\Component\Filesystem\Path utility class in Symfony 5.4.56. The core issue lies in the logic of Path::split(), which is used by isBasePath(), canonicalize(), join(), makeAbsolute(), and makeRelative().

The flaw is a logic mismatch between PHP's native path resolution and Symfony's custom path parsing:
1. PHP's Behavior: PHP treats a string as a URI (with a scheme) only if the scheme appears at the very beginning of the string (e.g., http://...). If a string starts with / or ./, PHP treats it as a local filesystem path, even if it contains :// later in the string.
2. Symfony's Flawed Behavior: Path::split() incorrectly identifies the "root" of a path as everything before the first ://. It does not verify that this prefix is a valid URI scheme (e.g., http, file, phar). Consequently, if an attacker crafts a path like /base/../x://../secret.txt, Symfony's Path::isBasePath('/base', ...) will incorrectly return true because it sees /base as the root and ignores the .. segments in the "scheme" part (x://). However, when PHP actually opens this file, it sees /base/../x://../secret.txt as a local path, resolves the .. segments, and accesses /secret.txt (outside the intended /base directory).

This allows an attacker to bypass path containment checks (like isBasePath) and read or write files outside the intended directory.

⚡ Attack Chain

1. Discovery & Reconnaissance

  • Identify Symfony Version: Use tools like whatweb, wappalyzer, or manual inspection of composer.json (if exposed) or error pages to confirm the target is running Symfony 5.4.56.
  • Identify Vulnerable Components: Determine if the application uses Symfony\Component\Filesystem\Path for user-supplied path validation. Common scenarios include:
  • * File upload/download features that validate paths against a base directory. * The AssetMapper component (Symfony 6.4+, but the underlying Path logic is shared) where CSS/JS files from remote packages are processed. * Custom code that uses Path::isBasePath() or Path::canonicalize() on user input.

    2. Exploitation

    The attacker crafts a path that contains :// in a position where PHP treats it as a local path, but Symfony's Path class treats it as a URI scheme boundary.

    Key Payload Structure:
    <base_dir>/../<dummy_scheme>://<traversal_segments>/<target_file>

  • <base_dir>: The expected base directory (e.g., /var/www/html/assets).
  • <dummy_scheme>: A string that looks like a scheme but is not at the start of the string (e.g., x, a, b).
  • <traversal_segments>: ../ sequences to escape the base directory.
  • <target_file>: The sensitive file to access (e.g., /etc/passwd, ../config/parameters.php).
  • Illustrative PoC (PHP Context):
    Assume an application has a function readFile(string $path) that does:

    $basePath = '/var/www/html/assets';
    if (Path::isBasePath($basePath, $path)) {
        // Vulnerable: Path::isBasePath returns true for malicious input
        $content = file_get_contents($path); // PHP resolves the path correctly, bypassing the check
        echo $content;
    }

    Malicious Input:
    /var/www/html/assets/../x://../../etc/passwd

  • Symfony's Path::isBasePath Logic:
  • * Splits at first ://. Root = /var/www/html/assets/... Checks if /var/www/html/assets/.. starts with /var/www/html/assets. It does (after normalization in some contexts, or due to the flawed split logic described in the CVE). Note: The CVE states Path::isBasePath('/base', '/base/../x://../secret.txt') returns true.*
  • PHP's file_get_contents Logic:
  • * Sees /var/www/html/assets/../x://../../etc/passwd. * No scheme at start. Treats as local path. * Resolves: /var/www/html/assets -> .. -> /var/www/html -> x:// (treated as directory name x:) -> .. -> /var/www -> .. -> / -> etc/passwd. * Result: Reads /etc/passwd.

    AssetMapper Specific Exploit (Symfony 6.4+ context, but relevant to the Path flaw):
    If the application uses importmap:require or importmap:install with a malicious package:
    1. Attacker publishes a package with a CSS file containing:

    @import url(../../../../../public/x://shell.php);

    2. Symfony's AssetMapper uses Path::join() to construct the path for the referenced file.
    3. The Path class fails to resolve the .. segments correctly due to the :// in the path, leading to a path traversal.
    4. The system writes shell.php to public/x:/shell.php (or similar, depending on OS path resolution quirks with :).

    3. Post-Exploitation

  • Arbitrary File Read: Access sensitive configuration files (/var/www/html/.env, /etc/passwd, /etc/shadow if permissions allow).
  • Arbitrary File Write: If the application allows writing files based on user input (e.g., uploading a file with a crafted name), the attacker can write a PHP webshell to a web-accessible directory.
  • * Example: Write shell.php to /var/www/html/public/shell.php. * Access http://target/public/shell.php to execute arbitrary commands.
  • RCE: Achieved via webshell execution or by overwriting critical application files.
  • 🌍 Real World Impact

  • Confidentiality: High. Attackers can read sensitive files outside the intended directory, including environment variables, database credentials, and system files.
  • Integrity: High. Attackers can write files outside the intended directory, potentially overwriting application code, configuration files, or creating webshells.
  • Availability: Low/Medium. While direct DoS is not the primary impact, overwriting critical files could lead to application downtime.
  • Practical Consequences:

  • Data Breach: Exposure of .env files leads to database and API key compromise.

  • Full Compromise: Webshell deployment leads to full server compromise.

  • Supply Chain Attack: In the context of AssetMapper, a malicious npm/packagist package can compromise all applications that install it, leading to widespread RCE.
  • 🛡️ Remediation & Mitigation

    1. Upgrade

  • Affected Versions: Symfony 5.4.56 (and potentially earlier 5.4.x versions with the same Path logic).
  • Fix: Upgrade to the latest patched version of Symfony 5.4.x or migrate to Symfony 6.4/7.x where the Path component has been corrected to only treat prefixes as schemes if they match PHP's stream wrapper naming conventions (2+ alphanumeric chars, +, -, . followed by :// at the start).
  • Command:
  • composer update symfony/filesystem symfony/symfony

    2. Workarounds (If Immediate Upgrade is Not Possible)

  • Avoid Path::isBasePath for Security Checks: Do not rely solely on Path::isBasePath() or Path::canonicalize() for security validation of user-supplied paths.
  • Use realpath() for Validation:
  • $basePath = realpath('/var/www/html/assets');
        $userPath = realpath($userInput);
        if ($userPath && str_starts_with($userPath, $basePath . DIRECTORY_SEPARATOR)) {
            // Safe to proceed
        } else {
            // Reject path
        }

    Note: realpath() resolves .. segments and returns false if the path does not exist or is invalid, providing a more robust check.

  • Sanitize Input: Strip or reject any input containing :// unless it is explicitly expected and validated as a URI scheme at the start of the string.

  • Disable AssetMapper if Not Needed: If using Symfony 6.4+ and not using AssetMapper, disable the component to reduce attack surface.
  • 3. Detection (IoCs)

  • Web Server Logs: Look for requests containing :// in path parameters, especially in file upload/download endpoints.
  • * Example: GET /download?file=../../x://../../etc/passwd
  • File System Monitoring: Monitor for unexpected file creation or modification in directories outside the expected asset/upload directories.
  • * Example: New files appearing in /var/www/html/public/ with names containing : or unusual extensions.
  • Process Monitoring: Look for PHP processes spawning shells or accessing sensitive files like /etc/passwd or /etc/shadow.
  • ⚠️ Urgency

    CVSS Score: 0/10 (NONE) - Note: This score appears incorrect or placeholder in the provided data. Given the nature of the vulnerability (Path Traversal leading to RCE), the actual CVSS score should be High or Critical (e.g., 7.5-9.8).*
    CISA KEV: No - Not currently listed in CISA's Known Exploited Vulnerabilities catalog, but this does not mean it is not being exploited.*

  • Exploit Complexity: Low. The payload is simple and does not require authentication in many scenarios.

  • Patching Priority: HIGH.

* This is a critical path traversal vulnerability that can lead to Remote Code Execution (RCE).
* It affects a widely used framework (Symfony).
* The fix is straightforward (upgrade).
* Recommendation: Patch immediately. If immediate patching is not possible, implement the realpath() workaround and monitor for exploitation attempts.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

header="X-Powered-By" && header="PHP"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-135803
Technical reference / advisory repository for CVE-2026-135803
CVSS Score
9.1 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Affected Products (2)
Symfony:symfony/filesystem (5.4.56) Symfony:symfony/symfony (5.4.56)
References & Advisories (3)
Related CVEs
8.1
CVE-2026-144674
UVdesk core-framework through 1.1.7 contains a missing authorization vulnerability in EmailSettingsXHR::update
9.9
CVE-2026-77526
FacturaScripts is an open source accounting and invoicing software. From version 2025 to before version 2026.3
9.8
CVE-2026-145055
PraisonAI pip praisonai before 4.8.0, praisonaiagents and npm praisonai before 1.8.0, and praisonai-bot, prais
9.4
CVE-2026-129109
Calico installations managed by the Tigera Operator install a FlexVolume driver (nodeagent~uds/uds) on every L
9.4
CVE-2026-64883
Path traversal in the WebDAV interface (DotWebdavHelper and the WebDAV temporary-file COPY and MOVE handling)
8.6
CVE-2026-115524
Path traversal in the push-publish bundle receiver (BundlePublisherResource, /api/bundlePublisher/publish) in
8.3
CVE-2026-144679
Thanos through 0.42.5 contains a path traversal vulnerability in Receive that allows unauthenticated remote-wr