CVE-2025-1022

8.2 HIGH

📋 TL;DR

This vulnerability in spatie/browsershot allows attackers to bypass file URI scheme validation by omitting slashes in file paths, potentially enabling local file inclusion attacks. It affects applications using vulnerable versions of the spatie/browsershot package to process untrusted HTML content. The vulnerability could allow reading sensitive files from the server filesystem.

💻 Affected Systems

Products:
  • spatie/browsershot
Versions: Versions before 5.0.5
Operating Systems: All operating systems where PHP and spatie/browsershot are installed
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications that process untrusted HTML input using the vulnerable setHtml function.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could read sensitive system files like /etc/passwd, /etc/shadow, application configuration files, or database credentials, potentially leading to full system compromise.

🟠

Likely Case

Local file inclusion allowing attackers to read application configuration files, source code, or other sensitive data stored on the server.

🟢

If Mitigated

Limited impact if proper input validation and file access controls are implemented at the application level.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Proof of concept available in GitHub gist. Exploitation requires ability to control HTML input passed to Browsershot::html().

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 5.0.5

Vendor Advisory: https://github.com/spatie/browsershot/commit/bcfd608b264fab654bf78e199bdfbb03e9323eb7

Restart Required: No

Instructions:

1. Update spatie/browsershot to version 5.0.5 or later using composer: composer update spatie/browsershot. 2. Verify the update completed successfully. 3. Test that HTML processing functionality still works as expected.

🔧 Temporary Workarounds

Input validation workaround

all

Implement custom validation to block file URI schemes in HTML input before passing to Browsershot

🧯 If You Can't Patch

  • Implement strict input validation to reject HTML containing any file: URI schemes
  • Restrict file system permissions for the web server user to limit accessible directories

🔍 How to Verify

Check if Vulnerable:

Check composer.json or run composer show spatie/browsershot to see if version is below 5.0.5

Check Version:

composer show spatie/browsershot | grep versions

Verify Fix Applied:

Verify spatie/browsershot version is 5.0.5 or higher using composer show spatie/browsershot

📡 Detection & Monitoring

Log Indicators:

  • Unusual file access patterns from web application
  • Failed attempts to access system files

Network Indicators:

  • HTTP requests containing file: URI schemes in HTML payloads

SIEM Query:

web_access_logs WHERE uri CONTAINS 'file:' OR payload CONTAINS 'file:'

🔗 References

📤 Share & Export