Descrizione

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.

Testo originale del record CVE (in inglese).

Come correggere

Priorità: Alta — pianificare la correzione entro pochi giorni. Motivazione: CVSS 9.1, EPSS 0.8% (percentile 52).

Versioni da aggiornare

  • Symfony symfony/filesystem: vulnerabili le versioni dalla 5.4.0 precedenti alla 5.4.56 → aggiornare alla 5.4.56 o successiva.
  • Symfony symfony/filesystem: vulnerabili le versioni dalla 6.0.0 precedenti alla 6.4.50 → aggiornare alla 6.4.50 o successiva.
  • Symfony symfony/filesystem: vulnerabili le versioni dalla 7.0.0 precedenti alla 7.4.23 → aggiornare alla 7.4.23 o successiva.
  • Symfony symfony/filesystem: vulnerabili le versioni dalla 8.0.0 precedenti alla 8.1.11 → aggiornare alla 8.1.11 o successiva.
  • Symfony symfony/symfony: vulnerabili le versioni dalla 5.4.0 precedenti alla 5.4.56 → aggiornare alla 5.4.56 o successiva.
  • Symfony symfony/symfony: vulnerabili le versioni dalla 6.0.0 precedenti alla 6.4.50 → aggiornare alla 6.4.50 o successiva.
  • Symfony symfony/symfony: vulnerabili le versioni dalla 7.0.0 precedenti alla 7.4.23 → aggiornare alla 7.4.23 o successiva.
  • Symfony symfony/symfony: vulnerabili le versioni dalla 8.0.0 precedenti alla 8.1.11 → aggiornare alla 8.1.11 o successiva.

Mitigazioni temporanee

Da applicare solo se non è possibile aggiornare subito:

  • Filtrare le sequenze di path traversal sul reverse proxy/WAF ed eseguire il servizio con permessi minimi sul filesystem.

Verifica

  1. Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
  2. Confrontare la versione installata con quelle indicate sopra.
  3. Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
  4. Ripetere la scansione per confermare la correzione.

Configurazioni interessate

VendorProdottoVersioni vulnerabiliCorretta in
Symfony symfony/filesystem ≥ 5.4.0 < 5.4.56 5.4.56
Symfony symfony/filesystem ≥ 6.0.0 < 6.4.50 6.4.50
Symfony symfony/filesystem ≥ 7.0.0 < 7.4.23 7.4.23
Symfony symfony/filesystem ≥ 8.0.0 < 8.1.11 8.1.11
Symfony symfony/symfony ≥ 5.4.0 < 5.4.56 5.4.56
Symfony symfony/symfony ≥ 6.0.0 < 6.4.50 6.4.50
Symfony symfony/symfony ≥ 7.0.0 < 7.4.23 7.4.23
Symfony symfony/symfony ≥ 8.0.0 < 8.1.11 8.1.11

Riferimenti