脆弱性ウォッチ

新着 / 2026年11月26日 / CVE-2026-135803

Symfony Filesystemのパス処理によるパストラバーサル脆弱性

緊急 9.1

掲載

何が問題か

Symfony\Component\FilesystemのPathクラスは、最初の://より前の部分をルートとして扱い、その中の..を解決しません。そのため、isBasePath()やcanonicalize()などで検証した入力パスが、実際にはディレクトリ外のファイルを指す場合があります。AssetMapperコンポーネントでもリモートパッケージのCSS由来のパスで同様の問題が起こるとされています。

悪用されると

この検証を前提にユーザー入力のパスを開くアプリケーションでは、想定外のディレクトリの外にあるファイルを読み書きされるおそれがあります。AssetMapperでは、悪意のあるパッケージにより、assets/vendor外へファイルを書き込まれるおそれがあります。

取るべき対応

Symfonyを利用している場合は、修正版への更新を確認してください。修正版の番号は公表されていません。自前でPathの検証結果に依存している場合は、その処理を見直してください。

AIが出典から要約し、数値を機械照合しています。

更新履歴

  1. 初回掲載。

指標

深刻度(CVSS v3.1)緊急 9.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
実際の攻撃での悪用CISA KEVには未掲載
30日以内に悪用される確率(EPSS)0.3%(全体の上位 85.4%)
問題の種類CWE-22
CVE公開日2026-11-24

出典

公式の説明(英語の原文)

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.