Hono: `validator('form')` skips validation for `multipart/form-data` requests with extra parameters
Summary
validator('form') only recognizes a multipart/form-data Content-Type that carries nothing but a single boundary parameter. A request with another legal parameter, such as charset, or with extra whitespace after the ; is not recognized as a form. The validation callback then receives an empty object, while c.req.parseBody() still parses the body as a form.
Details
The check that decides whether a request body is a form was written as a strict pattern over the whole Content-Type value. Any parameter list that does not look exactly like ; boundary=... fails 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 still read all submitted fields through c.req.parseBody() or c.req.formData().
application/x-www-form-urlencoded is not affected. Only the multipart/form-data branch has the strict pattern.
This issue arises when an application relies on validator('form') to reject or restrict fields and the validation callback does not fail on an empty object.
Impact
An unauthenticated client can send form fields that the form validator never sees, by adding a legal parameter to the Content-Type header.
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('form') with multipart/form-data requests and whose validation callback accepts an empty object.
Workarounds
Reject an empty object in the validator('form') callback, or validate the result of await c.req.parseBody() in the handler.
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | hono | >= 4.5.1, < 4.13.16 | 4.13.16 |
Referencias
- Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N- Debilidad (CWE)
CWE-1471, CWE-20- Plataforma
- npm
- Paquete
hono- Publicada
- 12.11.2026
- Actualizado
- 13.11.2026 01:17
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-4h7h-rv7c-7m2v - CC BY 4.0
Historial de vulnerabilidades: hono
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 57
- Primera → última
- 12.2023 11.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Alta 7
- Media 45
- Baja 5
Divulgaciones por año
- 2023: 1
- 2024: 3
- 2025: 4
- 2026: 49
-
Hono: `validator('form')` skips validation for `multipart/form-data` requests with extra parameters esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.