CVE-2026-142649: Laravel: `in` / `Rule::in` validation rule bypass via loose comparison
Laravel is a web application framework. Prior to 12.67.0 and 13.26.0, The in validation rule (and Rule::in, and notin via the same code) compares the scalar input to the allowlist with a non-strict inarray(). PHP 8 then compares numeric strings numerically, so many values that are not literally in the list pass validation , including whitespace-padded, leading-zero, signed, and scientific-notation forms, and an embedded newline. The value returned by validated() / valid() is the raw, un-canonicalized input, so the attacker-controlled bytes flow through to the application even though the rule was supposed to constrain them to a fixed set. The array branch of the same method already compares as strings (arraydiff), so this is an internal inconsistency, not intended behavior. Any allowlist of numeric values , feature flags (in:0,1), status codes, role/tenant/enum IDs stored as integers may be bypassed with an equivalent-but-not-identical representation. This issue is fixed in versions 12.67.0 and 13.26.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 12.67.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 13.26.0
Event History
Frequently Asked Questions
Which applications are exposed to this bypass?
Applications using Laravel versions before 12.67.0 or 13.26.0 are exposed where scalar request input is validated with in, Rule::in, or not_in against numeric allowlist values. Common affected uses include feature flags, status codes, and integer-backed role, tenant, or enum IDs.
What does an attacker need to exploit the issue?
An attacker only needs to submit a scalar value to a validation path using one of the affected rules. They can use a numerically equivalent but non-identical representation, such as whitespace-padded, leading-zero, signed, scientific-notation, or newline-containing input.
Why can this matter if validation succeeds?
validated() and valid() return the original raw input rather than a canonicalized allowlist value. As a result, attacker-controlled bytes can reach application logic despite the value having passed an allowlist check.
Are array inputs affected in the same way?
No. The array branch uses string comparison through array_diff, so the described loose-comparison bypass applies to scalar input handling.
What versions contain the fix?
The issue is fixed in Laravel 12.67.0 and 13.26.0.