GHSA-H2HG-MFJ4-RG7Q
`in` / `Rule::in` validation rule bypass via loose comparison
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-H2HG-MFJ4-RG7Q divulgada · CVSS 5.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
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 https://github.com/laravel/framework/pull/61146
## Reported by
— Sergey Sannikov, GitHub @semx
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistlaravel/framework |
Corregida | 12.67.0, 13.26.0 | — | — |
12.67.013.26.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/laravel/framework/security/advisories/GHSA-h2hg-mfj4-rg7qLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
