Distinct validation rule bypass with invalid UTF-8 array keys
Summary
Impact
The distinct validation rule could be bypassed when duplicate values were submitted under array keys containing invalid UTF-8. Key matching in extractDistinctValues() used a Unicode-aware pattern, and a failed match was treated as no match, so those items were left out of the compa...
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| composerlaravel/framework |
<12.75.0→ >=12.75.0 |
>=12.75.0 |
| composerlaravel/framework |
<13.45.0→ >=13.45.0 |
>=13.45.0 |
Original description The description as published by the source.
Impact
The distinct validation rule could be bypassed when duplicate values were submitted under array keys containing invalid UTF-8. Key matching in extractDistinctValues() used a Unicode-aware pattern, and a failed match was treated as no match, so those items were left out of the comparison. Applications that validate array input from form-urlencoded or multipart bodies or query strings, and rely on distinct to reject repeated values, could accept duplicates. JSON request bodies are not affected because invalid UTF-8 is rejected during decoding.
Patches
The fix has been merged for the 12.x and 13.x branches: https://github.com/laravel/framework/pull/62667 and https://github.com/laravel/framework/pull/62666.
Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
References
- GITHUB_REPO_ADVISORY laravel/framework