GHSA-92P4-J3WQ-JMQX
`validator()` skips validation for requests whose `Content-Type` parameters are formatted differently (incomplete fix for GHSA-4h7h-rv7c-7m2v)
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-92P4-J3WQ-JMQX divulgada · CVSS 5.3 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Remediación | Parche 4.13.18 | hono · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
`validator('json')` and `validator('form')` decide whether to read the request body by matching the whole `Content-Type` value against a strict pattern. A value that is legal but formatted differently, such as whitespace before `;`, a trailing `;`, or a parameter name with an underscore, does not match. The validation callback then receives an empty object, while `c.req.json()` and `c.req.parseBody()` in the handler still read the body.
GHSA-4h7h-rv7c-7m2v fixed this for a `multipart/form-data` value with extra parameters. The same problem remained for other parameter formats and for `application/json`.
Details
The media type and its parameters were checked together with one pattern per target. Anything outside the pattern, including `application/json ; charset=utf-8`, `multipart/form-data; boundary=x;` and `application/x-www-form-urlencoded; x_y=1`, failed the check. When it fails, the middleware does not read the body and passes an empty object to the validation callback. If the callback accepts an empty object, the request proceeds to the handler, which can read all submitted fields.
The validator now takes the media type as the part before the first `;`, trimmed and lowercased, and decides on that alone. This is the same rule `c.req.parseBody()` uses, so the two can no longer disagree about the same request. Structured JSON suffixes such as `application/vnd.api+json` and subtypes containing digits are accepted as JSON.
This issue arises when an application relies on `validator('json')` or `validator('form')` to reject or restrict fields and the validation callback does not fail on an empty object.
Impact
An unauthenticated client can send JSON or form fields that the validator never sees, by formatting the `Content-Type` header differently.
This may lead to:
- Allow-list or required-field checks in the validator being skipped
- Fields the application intended to reject reaching the handler
This issue affects applications that use `validator('json')` or `validator('form')` and whose validation callback accepts an empty object.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmhono |
Corregida | 4.13.18 | 0 d | 4.13.19 no afectada |
4.13.18Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/honojs/hono/security/advisories/GHSA-92p4-j3wq-jmqxLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
