GHSA-WWQ3-M3J5-WV66
Validation exists rule can be bypassed with integer or boolean input on MySQL/MariaDB
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-WWQ3-M3J5-WV66 divulgada · CVSS 5.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
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.
Patches
`DatabasePresenceVerifier` now compares integers and booleans as strings. The fixes are merged on the 13.x branch (https://github.com/laravel/framework/pull/62447) and the 12.x branch (https://github.com/laravel/framework/pull/62448).
Workarounds
Add the `string` rule (or `integer`, as appropriate) before `exists` and `unique` rules, or cast the input in `prepareForValidation()`.
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.73.0, 13.43.0 | — | — |
12.73.013.43.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-wwq3-m3j5-wv66Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
