Spatie Browsershot Directory Traversal vulnerability
Impact
Versions of the package spatie/browsershot before 5.0.2 are vulnerable to Directory Traversal due to URI normalisation in the browser where the file:// check can be bypassed with file:\\. An attacker could read any file on the server by exploiting the normalization of \ into /.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| Earlier releases before 5.0.2Ecosystem versions | 5.0.2 |
Version evidence: OSV · GHSA-v528-6rq9-h6gw
View original version evidence (154 explicit versions)
Original source description
Versions of the package spatie/browsershot before 5.0.2 are vulnerable to Directory Traversal due to URI normalisation in the browser where the file:// check can be bypassed with file:\. An attacker could read any file on the server by exploiting the normalization of \ into /.
References
- Security advisory nvd.nist.gov/vuln/detail/CVE-2024-21547
- Patch github.com/spatie/browsershot/commit/dfc3635b83dd980e5c39f8f8c73e87723b99ca01
- Source reference gist.github.com/chuajianshen/baa71db588cfc038fb5d65624a47be81
- Source reference github.com/spatie/browsershot
- Security advisory security.snyk.io/vuln/SNYK-PHP-SPATIEBROWSERSHOT-8501858