File validation bypass via empty input field colliding with an upload in Request::all()
Summary
Impact
In Laravel 13.x, Request::all() let a text input with the same name as an uploaded file take precedence over the file. If an attacker submitted an empty value alongside the file, request validation (including FormRequest validation) saw the empty value instead of the upload. Rules...
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| composerlaravel/framework |
<13.43.0→ >=13.43.0 |
>=13.43.0 |
| composerlaravel/framework |
<12.73.0→ >=12.73.0 |
>=12.73.0 |
Original description The description as published by the source.
Impact
In Laravel 13.x, Request::all() let a text input with the same name as an uploaded file take precedence over the file. If an attacker submitted an empty value alongside the file, request validation (including FormRequest validation) saw the empty value instead of the upload. Rules such as nullable, image, mimes and max were then skipped. Applications that validate an optional upload this way and then read it with $request->file() or $request->hasFile() could therefore store files that bypassed type and size validation.
Patches
Empty input values (null, empty string or empty array) no longer shadow a colliding uploaded file in Request::all(). This is fixed in laravel/framework 13.x by https://github.com/laravel/framework/pull/62521 and released in v13.43.0.
Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
References
- GITHUB_REPO_ADVISORY laravel/framework