maatwebsite/excel security advisory
CVE-2026-84374: Laravel Excel writes exports outside the configured filesystem disk when given a caller-controlled path
CVE-2026-84374 is a high-severity remote code execution vulnerability in the PHP package maatwebsite/excel (CVSS 7.5), published 1 September 2026. It is fixed in 3.1.70; earlier versions are affected. Exploiting it needs a low-privilege user account.
high 7.5 published 2026-09-01 · updated 2026-09-09
- Affected versions
- >= 3.1.8, < 3.1.70
- Fixed in
- 3.1.70
- Newest release
- 4.0.6
- Severity
- High · CVSS 7.5
- Type
- Remote code execution
CWE-22, CWE-73 - Exploited in the wild
- Not on the CISA KEV list
checked 2026-11-04
Is your maatwebsite/excel version affected?
Who can exploit CVE-2026-84374
- Access: A normal, low-privilege user account in the app.
- Conditions: It only works under specific conditions the attacker does not fully control (CVSS rates the attack as high complexity).
CVSS vector (scored by GitHub): CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
How to fix CVE-2026-84374 in maatwebsite/excel
- Find the installed version:
composer show maatwebsite/excel. If you never required it yourself,composer why maatwebsite/excelshows which package pulls it in. - Update it:
composer update maatwebsite/excel --with-all-dependencies. You need 3.1.70 or newer. - If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example
"maatwebsite/excel": "^3.1.70"if you can take that version), or upgrade the package that requires it. - Run
composer audit. It reads the same advisory data and should no longer list CVE-2026-84374. - Commit composer.lock and deploy it. On the server, run
composer install --no-devfrom the lock file, notcomposer update.
If you cannot upgrade yet
- Never pass user-controlled data to unserialize() or to template rendering, and restrict who can edit templates or settings.
- Put a web application firewall in front of the app and watch for new PHP files or admin users.
- If your app does not use the affected feature, note that in your audit, but still plan the upgrade.
The CVE-2026-84374 advisory
Laravel Excel provides supercharged Excel exports and imports in Laravel. From 3.1.8 until 3.1.70, in src/Files/Disk.php the Maatwebsite\Excel\Files\Disk::copy() method resolves the caller-controlled $destination supplied through Excel::store(), $export->store(), or storeExcel() against the process working directory with realpath() instead of the configured filesystem disk. If the path names an existing writable file, Disk::copy() opens it with fopen() in rb+ mode and uses stream_copy_to_stream(), bypassing Flysystem path confinement and allowing an attacker whose application input controls the export path to overwrite arbitrary existing files with export content. The rb+ behavior creates a non-truncating overwrite and trailing bytes when the new export is shorter, and overwriting an executable PHP file can lead to remote code execution. This issue is fixed in version 3.1.70.
References
- GitHub advisory GHSA-c7r6-vx3h-w5g2 github.com
- Fix commit b5cafdf github.com
- Release 3.1.70 github.com
Related
Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.
Ask about a fixWhere this data comes from
- Affected and fixed versions: the Packagist security advisories API (GitHub Advisory Database and FriendsOfPHP), the same data
composer audituses. Synced 2026-11-03. - Description, score, weakness and references: NIST National Vulnerability Database (NVD), checked 2026-11-04. This product uses data from the NVD API but is not endorsed or certified by the NVD.
- Exploited-in-the-wild status: the CISA Known Exploited Vulnerabilities catalog, checked 2026-11-04.
- Compiled by Daniel Lasek at Laskyr from the sources above. The summary, “who can exploit it”, “how to fix it” and hardening sections are our plain-English reading of the record and are generated from it. The quoted description is the record's own text. Spot an error? Tell us.