← VULNERABILITIES

CVE-2026-135803

Filesystem Path Treats Any Prefix Before "://" as a Root, Letting Paths Escape Their Base Directory

Critical · 9.1Fix available
CVSS
9.1
EPSS
0.77% (p52)
Published
2026-11-24
Age
5d old
Modified
2026-11-25
Product
Symfony symfony/filesystem
Aliases
GHSA-6prc-h956-hxjq

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Description

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.

Fixed in

5.4.56 · 6.4.50 · 7.4.23 · 8.1.11

Affected packages

EcosystemPackageRangeFixed
unknownsymfony/filesystem>=5.4.0, <5.4.565.4.56
unknownsymfony/filesystem>=6.0.0, <6.4.506.4.50
unknownsymfony/filesystem>=7.0.0, <7.4.237.4.23
unknownsymfony/filesystem>=8.0.0, <8.1.118.1.11
unknownsymfony/symfony>=5.4.0, <5.4.565.4.56
unknownsymfony/symfony>=6.0.0, <6.4.506.4.50
unknownsymfony/symfony>=7.0.0, <7.4.237.4.23
unknownsymfony/symfony>=8.0.0, <8.1.118.1.11

Sources

  • NVD · first seen 5d ago · NVD terms of use
  • OSV · first seen 3d ago · CC-BY 4.0
  • CVE List · first seen 5d ago · CVE Terms of Use

References

JSON