medium

CVE-2026-142643

Packagist · laravel/framework

Summary

Laravel: Validation exists rule can be bypassed with integer or boolean input on MySQL/MariaDB

Severity
medium
CVSS
5.3
EPSS
0.4% (p40)
CWE
CWE-843, CWE-1287
Also known as
GHSA-wwq3-m3j5-wv66
Published
2026-12-03
Updated
2026-12-03

Advisory 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().

References

Related advisories

Is your project exposed to this? Stateward checks every dependency on every pull request and flags it only if your code actually reaches it.

Check my repo

Summarize with AI

ChatGPTClaudePerplexity

Sources: CISA KEV (public domain), OSV.dev & GitHub Advisory Database (CC-BY-4.0), FIRST EPSS, NVD/CWE (public domain). Served live from the Stateward advisory database.