# CVE-2026-84374: Laravel Excel writes exports outside the configured filesystem disk when given a caller-controlled path

> Attackers can overwrite arbitrary files via path traversal in Laravel Excel exports, potentially achieving remote code execution if PHP files are targeted.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Sep 2026
- **Updated:** 4 Sep 2026
- **Also known as:** GHSA-c7r6-vx3h-w5g2

## What is CVE-2026-84374?

CVE-2026-84374 is a high-severity path traversal vulnerability in SpartnerNL Laravel-Excel, published on 1 Sep 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

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.

Weakness: CWE-73 (External Control of File Name or Path), CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-84374?

2 open source packages ship an affected version, including maatwebsite/excel.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `maatwebsite/excel` | Packagist | From 3.1.8 | 3.1.70 |
| `maatwebsite/excel` | Packagist | From 3.1.8 | 3.1.70 |

## How do I fix CVE-2026-84374?

Upgrade maatwebsite/excel to 3.1.70 or later.

## Is CVE-2026-84374 being exploited?

There is no known exploitation of CVE-2026-84374 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-84374 and fix it if it is affected.

What it is: CVE-2026-84374 is a high-severity path traversal vulnerability in SpartnerNL Laravel-Excel, published on 1 Sep 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-84374 in the wild and no public exploit code.

Affected packages and fixed versions:
- maatwebsite/excel (Packagist): affected from 3.1.8; fixed in 3.1.70
- maatwebsite/excel (Packagist): affected from 3.1.8; fixed in 3.1.70

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-84374/ (Markdown: https://insights.sbomify.com/CVE-2026-84374/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-84374
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-84374
- OSV: https://osv.dev/vulnerability/CVE-2026-84374

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-84374/
Summaries are generated and may contain mistakes; the official description above is the record.
