CVE-2026-135803 in Filesystem
Summary
by MITRE • 11/24/2026
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.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/26/2026
The vulnerability in Symfony's Filesystem component stems from a fundamental flaw in how the Path::split() method parses URI-like prefixes within file paths. The core issue is that this method assumes any text preceding the first occurrence of :// constitutes a valid URI scheme, without verifying whether it actually meets the criteria for a registered PHP stream wrapper. Consequently, path traversal sequences such as .. located within this assumed prefix are not resolved or normalized. This behavior creates a discrepancy between how PHP itself interprets certain paths and how Symfony's Path utility processes them. For instance, while PHP treats /base/../x://../secret.txt as a local file path resolving to /secret.txt because it does not recognize x:// as a valid scheme, Symfony’s Path::isBasePath() incorrectly validates this against the base directory /base, returning true and thereby bypassing intended security checks.
This technical flaw has significant operational impacts on applications that rely on these methods for access control validation before performing file operations. When developers use functions like isBasePath(), canonicalize(), join(), makeAbsolute(), or makeRelative() to sanitize user-supplied paths, they may inadvertently allow attackers to escape the designated directory structure. By injecting a fake scheme prefix containing path traversal characters, an attacker can trick these methods into believing that a maliciously crafted path remains within the allowed base directory. This enables unauthorized reading of sensitive files outside the expected scope or writing arbitrary content to unintended locations on the filesystem. The vulnerability effectively undermines common security patterns used for preventing Local File Inclusion and Arbitrary File Write attacks in web applications utilizing Symfony components.
A particularly critical manifestation of this flaw occurs in the AssetMapper component, which is available in Symfony versions 6.4 and later. This component uses Path::join() to construct file paths based on references found within CSS files from remote packages during processes like importmap:require or importmap:install. A malicious or compromised package can exploit this by including a CSS rule with a url attribute containing a crafted path, such as ../../../../../public/x://shell.php. Due to the vulnerability, Symfony fails to resolve the .. segments correctly and instead treats x:// as part of the filename structure. This results in the creation of files like public/x:/shell.php outside the intended assets/vendor directory, potentially leading to remote code execution if the web server interprets these files as executable scripts.
The remediation for this vulnerability involves a stricter definition of what constitutes a valid URI scheme prefix within path handling methods. The updated logic now requires that a prefix be recognized as a scheme only if it aligns with PHP’s expectations for stream wrapper names. Specifically, a valid scheme must consist of two or more characters comprising letters, digits, plus signs, hyphens, or periods, immediately followed by :// at the start of the path string. Any other prefixes are treated as regular local path segments, ensuring that .. sequences within them are properly resolved and normalized. This change preserves functionality for legitimate schemes such as phar://, file://, vfs://, and compress.zlib:// while eliminating the ambiguity that allowed attackers to bypass security controls using non-standard or fake scheme identifiers.
From a classification perspective, this vulnerability aligns with CWE-20 Improper Input Validation, as the application fails to adequately validate input data before processing it for path resolution. It also relates to CWE-78 OS Command Injection in contexts where file writes lead to execution, and CWE-59 Improper Link Resolution Before File Access when considering the bypass of directory restrictions. In terms of attack vectors, this flaw facilitates techniques associated with ATT&CK T1046 Network Service Scanning for path discovery or more directly T1083 File and Directory Discovery if used for information gathering, but most critically it enables T1505.003 Web Shell: ASPX/PHP/JSP/etc through the arbitrary file write capability in affected AssetMapper scenarios. Organizations running Symfony 6.4 or later should prioritize upgrading to patched versions that enforce strict scheme validation to prevent these path traversal and unauthorized access exploits.