CVE-2026-142643: Laravel: Validation exists rule can be bypassed with integer or boolean input on MySQL/MariaDB
Laravel is a web application framework. Prior to 13.43.0 and 12.73.0, 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. This issue is fixed in versions 13.43.0 and 12.73.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Laravelto a version that resolves this vulnerability.Fixed in 13.43.0 - Upgrade
Upgrade
Laravelto a version that resolves this vulnerability.Fixed in 12.73.0
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using Laravel before 13.43.0 or 12.73.0 are affected only when they use MySQL or MariaDB and accept JSON input for exists or unique validation against non-numeric string columns. PostgreSQL, SQLite, and form-encoded requests are not affected.
What does an attacker need to exploit the validation bypass?
An attacker needs to be able to submit JSON to an endpoint whose validation relies on an exists or unique rule for a non-numeric string column. No authentication is required when the vulnerable endpoint itself is publicly reachable.
How can I check whether a vulnerable endpoint is at risk?
Review JSON-consuming endpoints for validation rules such as required|exists:invites,code or unique rules that query string columns on MySQL or MariaDB. Such endpoints may accept integer or boolean JSON values including 0, false, or [0] where a valid string identifier should be required.
What can be done if upgrading is not immediately possible?
Restrict affected endpoints to form-encoded input where feasible, since form values are always strings. For JSON endpoints, enforce that the relevant field is a string before applying exists or unique validation.