Skip to content
Laskyr

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

Fixed in maatwebsite/excel 3.1.70

This remote code execution issue affects maatwebsite/excel versions >= 3.1.8, < 3.1.70. Upgrade to the fixed version for your release line (3.1.70). The newest release, 4.0.6, is not affected.

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?

Run composer show maatwebsite/excel in your project, then enter the version. We check it against this and every other known maatwebsite/excel advisory.

Who can exploit CVE-2026-84374

CVSS vector (scored by GitHub): CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Your app is only exposed if it uses the affected part of maatwebsite/excel. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-84374 in maatwebsite/excel

  1. Find the installed version: composer show maatwebsite/excel. If you never required it yourself, composer why maatwebsite/excel shows which package pulls it in.
  2. Update it: composer update maatwebsite/excel --with-all-dependencies. You need 3.1.70 or newer.
  3. 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.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-84374.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for remote code execution issues while the upgrade waits. None of it replaces the fix.

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.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-84374. Advisory title: “Laravel Excel writes exports outside the configured filesystem disk when given a caller-controlled path”.

References

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 fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit