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.
Published: 2026-09-01
Score: 7.5 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Laravel Excel allows a caller controlled export destination to be resolved against the process working directory instead of the configured filesystem disk, bypassing Flysystem path confinement. This means an attacker who supplies a controlled file name or path can cause the library to overwrite any writable file in the working directory. The overwrite occurs in rb+ mode, which does not truncate and may leave trailing bytes in the target file, potentially corrupting it or enabling code injection if the overwritten file is an executable, such as a PHP script. The vulnerability is present in Laravel-Excel versions 3.1.8 through 3.1.69 and was fixed in 3.1.70.

Affected Systems

SpartnerNL Laravel-Excel releases from 3.1.8 up to but excluding 3.1.70 are affected. Versions 3.1.70 and later contain the patch that restores proper disk path checks and prevents arbitrary file writes

Risk and Exploitability

The CVSS score of 7.5 indicates high severity. No EPSS score is available and the vulnerability is not listed in the CISA KEV catalog, suggesting a low current exploitation probability but still a serious risk. The likely attack vector requires an attacker to supply a malicious export path via the application, which is possible if the application accepts user control over the export destination without proper validation. Once the file is overwritten, especially executable scripts, the attacker can achieve remote code execution or persistent code injection.

Generated by OpenCVE AI on September 1, 2026 at 23:51 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade SpartnerNL Laravel-Excel to version 3.1.70 or later to apply the vendor patch
  • If upgrading immediately is not possible, validate and sanitize all export destination inputs to ensure they resolve only within the configured filesystem disk and reject any absolute or relative paths that target directories outside the disk
  • Restrict application permissions so that the user account running Laravel cannot write to critical files outside the intended export directory, and monitor for unexpected file modifications

Generated by OpenCVE AI on September 1, 2026 at 23:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 01 Sep 2026 22:00:00 +0000

Type Values Removed Values Added
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.
Title Laravel Excel writes exports outside the configured filesystem disk when given a caller-controlled path
Weaknesses CWE-22
CWE-73
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-09-01T21:28:30.355Z

Reserved: 2026-09-01T16:27:58.129Z

Link: CVE-2026-84374

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-01T22:17:19.293

Modified: 2026-09-01T22:17:19.293

Link: CVE-2026-84374

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-02T00:00:06Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-73

    External Control of File Name or Path