Laravel: Validation exists rule can be bypassed with integer or boolean input on MySQL/MariaDB
Published 3 Dec 2026 · Updated 3 Dec 2026
Affected packages
- Affected
- >=13.0.0 <13.43.0
- Fixed in
- 13.43.0
composer require laravel/framework:^13.43.0- Affected
- <12.73.0
- Fixed in
- 12.73.0
composer require laravel/framework:^12.73.0Which laravel/framework does your project really install?
Works for private projects: the file is read in memory to run the scan and then dropped. Also reads composer.json.
Public repo?
Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Details
Impact
The exists and unique validation rules passed integer and boolean values from the request unchanged to the database query. On MySQL and MariaDB, comparing a string column with an integer casts the column to a number. As a result, JSON input such as 0, false or [0] could satisfy a rule like required|exists:invites,code on a non-numeric string column without a valid value. An unauthenticated attacker who can submit JSON could bypass "must reference an existing record" checks. PostgreSQL and SQLite are not affected. Form-encoded input is always a string and is not affected.
Patches
DatabasePresenceVerifier now compares integers and booleans as strings. The fixes are merged on the 13.x branch (https://github.com/laravel/framework/pull/62447) and the 12.x branch (https://github.com/laravel/framework/pull/62448).
Workarounds
Add the string rule (or integer, as appropriate) before exists and unique rules, or cast the input in prepareForValidation().
Is GHSA-wwq3-m3j5-wv66 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected laravel/framework, and gives you the command that fixes it.
More advisories for laravel/framework
- HighCVE-2026-142610Laravel: Numeric validation can exhaust resources via extreme exponent input · 4 Dec 2026
- LowCVE-2026-142622Laravel: Cross-Origin Auth Token Leakage Through Broadcasting JSONP Callback · 3 Dec 2026
- MediumCVE-2026-142637Laravel: Fluent Rule::exists() and Rule::unique() where() values can be interpreted as reserved predicates instead of literal values · 3 Dec 2026
- MediumCVE-2026-142644Laravel: Quadratic regex backtracking in the decimal validation rule can cause denial of service · 3 Dec 2026
- MediumCVE-2026-142649Laravel: `in` / `Rule::in` validation rule bypass via loose comparison · 3 Dec 2026
- MediumCVE-2026-142624 Laravel: Nested sometimes validation rules skipped when value is __missing__ · 3 Dec 2026
References
- Linkgithub.com/laravel/framework/security/advisories/GHSA-wwq3-m3j5-wv66
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-142643
- Linkgithub.com/laravel/framework/pull/62447
- Linkgithub.com/laravel/framework/pull/62448
- Linkgithub.com/laravel/framework/commit/2b517db47fca33b9bf48a15287af63702ace3f99
- Linkgithub.com/laravel/framework/commit/a26c3295498fc4de4b878d634fe2a9ae264d9a29
- Packagegithub.com/laravel/framework
- Linkgithub.com/laravel/framework/releases/tag/v12.73.0
- Linkgithub.com/laravel/framework/releases/tag/v13.43.0
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.