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

Published Sep 1, 2026
·
Updated

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 streamcopytostream(), 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.

Affected Software

1 affected component
Maatwebsite\Excel>3.1.8<3.1.70

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Maatwebsite\Excel to a version that resolves this vulnerability.

    Fixed in 3.1.70

Event History

Sep 1, 2026
CVE Published
via MITRE·09:28 PM
Data Sourced
via MITRE·09:28 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are realistically exposed?

Applications using Maatwebsite\Excel versions 3.1.8 through 3.1.69 are exposed if untrusted application input can influence the destination path passed to Excel::store(), $export->store(), or storeExcel(). The issue affects writes to existing files that are writable by the application process.

2

What does an attacker need to exploit this?

An attacker needs low-privileged access to an application feature that lets them control, directly or indirectly, an export destination path. The target file must already exist and be writable by the process running the application.

3

Are default filesystem-disk restrictions sufficient protection?

No. The vulnerable Disk::copy() behavior resolves the supplied destination against the process working directory rather than the configured filesystem disk, bypassing Flysystem path confinement.

4

What can be done before upgrading?

Ensure export destination paths are not derived from user-controlled input and restrict them to application-generated filenames within an intended export location. Also limit the application process's write permissions, especially for PHP or other executable files.

5

How can I identify potentially affected code?

Review uses of Excel::store(), $export->store(), and storeExcel() for destination paths influenced by request parameters, user profile data, imported values, or other untrusted input. Check whether the application runs a version from 3.1.8 through 3.1.69; version 3.1.70 fixes the issue.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203