symfony/filesystem
symfony/filesystem: controllo percorsi aggirabile, file letti o scritti fuori cartella
Il problema, secondo i dati ufficiali
- Metodi come Path::isBasePath(), canonicalize(), join(), makeAbsolute() e makeRelative() considerano radice tutto ciò che precede il primo "://", senza verificare che sia uno schema URI, quindi i segmenti ".." in quel prefisso non vengono risolti.
- Un percorso come /base/../x://../secret.txt risulta dentro /base per isBasePath(), ma per PHP è il file locale /secret.txt. Le applicazioni che controllano così un percorso costruito da input utente e poi lo aprono possono leggere o scrivere file fuori dalla cartella prevista.
- In AssetMapper, un pacchetto remoto malevolo o compromesso può far scrivere a importmap:require o importmap:install un file a sua scelta fuori da assets/vendor.
- Il punteggio ufficiale indica sfruttamento via rete, senza bisogno di un account.
Cosa fare
- Aggiorna symfony/filesystem a una di queste versioni o successive, secondo il ramo che usi: 5.4.56, 6.4.50, 7.4.23, 8.1.11; symfony/symfony a una di queste versioni o successive, secondo il ramo che usi: 5.4.56, 6.4.50, 7.4.23, 8.1.11.
- Se non puoi aggiornare subito, applica le misure temporanee indicate nell'avviso del produttore (a volte chiede di spegnere il servizio); se non ne indica e il servizio è raggiungibile da internet, limita chi può raggiungerlo (VPN o filtro degli indirizzi).
Versioni interessate
- symfony/filesystem: dalla 5.4.0 alla 5.4.56 esclusa; dalla 6.0.0 alla 6.4.50 esclusa; dalla 7.0.0 alla 7.4.23 esclusa; dalla 8.0.0 alla 8.1.11 esclusa
- symfony/symfony: dalla 5.4.0 alla 5.4.56 esclusa; dalla 6.0.0 alla 6.4.50 esclusa; dalla 7.0.0 alla 7.4.23 esclusa; dalla 8.0.0 alla 8.1.11 esclusa
Fonti ufficiali
- symfony.com — avviso del produttore
- github.com — avviso del produttore
- github.com — patch
Descrizione ufficiale (in inglese)
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.
Non sai se ti riguarda?
Se usi symfony/filesystem e non sai quale versione hai, o hai un sito o un e-commerce da tenere al sicuro, possiamo controllarlo noi. Intanto puoi fare un primo controllo gratuito.
Il riassunto del problema è scritto da un modello linguistico (Claude di Anthropic) a partire dalla descrizione ufficiale, e controllato in automatico contro di essa. Soluzione e versioni vengono solo dai dati ufficiali (CISA KEV, NVD, CVE.org, FIRST EPSS). Ultimo aggiornamento: 1 dicembre 2026. Prima di intervenire verifica l'avviso del produttore.