Ad

CVE-2026-135803

NONE
Обновлено 24 ноября 2026
PHP
Параметр Значение
Тип уязвимости CWE-22 (Обход пути)
Поставщик PHP
Публичный эксплойт Нет

Большинство методов SymfonyComponentFilesystemPath полагаются на Path::split(), который принимает все, что до первого _ как корень пути. Он не проверяет, что этот префикс является схемой URI, поэтому сегменты в этом префиксе никогда не разрешаются. PHP видит схему только в начале строки.

Таким образом, /base/../x://../secret.txt - это простой локальный путь к /secret.txt для PHP, в то время как Path::isBasePath('/base', '/base/../x://../secret.txt') возвращает true. canonicalize(), join(), makeAbsolute() и makeRelative() затрагиваются одинаково. Некоторые приложения проверяют путь, построенный из пользовательского ввода с помощью isBasePath() или canonicalize(), а затем открывают его. Они могут быть сделаны для чтения или записи файлов за пределами ожидаемого каталога.

На Symfony 6.4 и позже компонент AssetMapper строит с помощью Path::join() путь к файлам, на которые удаленный пакет ссылается из своего CSS. Поэтому вредоносный или скомпрометированный пакет может сделать importmap:require или importmap:install написать файл по своему выбору вне активов / поставщика. Например, CSS url(../../../../../public/x://shell.php) пишет public/x:/shell.php.

Префикс теперь является схемой только тогда, когда PHP будет искать обертку потока с этим именем. То есть две или более буквы, цифры, +, - или ., за которыми следует :// в начале пути. Другие префиксы являются регулярными сегментами пути, и ... сегменты после них разрешаются.

Реальные схемы, такие как phar://, file://, vfs:// или compress.zlib://, продолжают работать.

Показать оригинальное описание (EN)

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.

Тип уязвимости (CWE)