Skip to content
Medium 5.3

File validation bypass via empty input field colliding with an upload in Request::all()

GHSA-hxc4-wvjf-r59p First seen on SecPulse

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

PackageAffected → Fixed
composerlaravel/framework
<13.43.0→ >=13.43.0
composerlaravel/framework
<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

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details