MediumGHSA-h2hg-mfj4-rg7qCVE-2026-142649

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

Published 3 Dec 2026 · Updated 3 Dec 2026

Affected packages

Affected
<12.67.0
Fixed in
12.67.0
Update to the fixed version for your release line, for example:composer require laravel/framework:^12.67.0
Affected
>=13.0.0 <13.26.0
Fixed in
13.26.0
Update to the fixed version for your release line, for example:composer require laravel/framework:^13.26.0

We confirm your address first. See our privacy policy.

Which laravel/framework does your project really install?

Drop your composer.lock hereWe find the exact laravel/framework version you install, even when another package pulls it in, and tell you if it’s affected and what to run. Free, no sign-up.

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

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

Is GHSA-h2hg-mfj4-rg7q 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-142643Laravel: Validation exists rule can be bypassed with integer or boolean input on MySQL/MariaDB · 3 Dec 2026
  • MediumCVE-2026-142624 Laravel: Nested sometimes validation rules skipped when value is __missing__ · 3 Dec 2026
All 51 advisories for laravel/framework

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.