Vulnerability GHSA-h2hg-mfj4-rg7q

Medium Risk
MEDIUM RISK
CVSS Score: 5.3
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
20 hours ago
December 03, 2026 at 06:54 PM UTC
Laravel: `in` / `Rule::in` validation rule bypass via loose comparison
4.0.0-BETA2 - 12.66.0 and 13.0.0 - 13.25.0
4.0.0-BETA2 - 12.66.0 and 13.0.0 - 13.25.0

Summary

Laravel: `in` / `Rule::in` validation rule bypass via loose comparison

Details

Summary

The in validation rule (and Rule::in, and not_in via the same code) compares the scalar input to the allowlist with a non-strict in_array(). 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 (array_diff), so this is an internal inconsistency, not intended behavior.

Impact

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.

Patched

Fixed in #61146

Reported by

— Sergey Sannikov, GitHub @semx

Impacted packages

Timeline

Published
20 hours ago
December 03, 2026 at 06:54 PM UTC
Fixed (13.26.0)
3 months ago
August 18, 2026 at 12:30 PM UTC
Fixed (12.67.0)
3 months ago
August 18, 2026 at 01:37 PM UTC
Last Modified
20 hours ago
December 03, 2026 at 07:15 PM UTC