REDHAT-BUG-2572853: Medium severity npm/hono vulnerability
Hono is a Web application framework that provides support for any JavaScript runtime. From 4.5.1 until 4.13.16, validator('form') uses a strict whole-header pattern that fails to recognize multipart/form-data when its Content-Type includes another legal parameter or extra whitespace after a semicolon. The validation callback receives an empty object even though c.req.parseBody() or c.req.formData() can still parse and expose all submitted fields to the handler. An unauthenticated client can therefore bypass allow-list or required-field checks when the application relies on the form validator and its callback accepts an empty object. application/x-www-form-urlencoded requests are not affected. This issue is fixed in version 4.13.16.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.13.16
Event History
Frequently Asked Questions
Which applications are exposed in practice?
Applications using Hono versions 4.5.1 through 4.13.15 are exposed when they rely on validator('form') to enforce allow-list or required-field checks and the validation callback accepts an empty object.
What does an attacker need to send to trigger the bypass?
An unauthenticated client must send a multipart/form-data request whose Content-Type has an additional legal parameter or extra whitespace after a semicolon. The body can still be parsed by c.req.parseBody() or c.req.formData(), despite the validator callback receiving an empty object.
Are URL-encoded form submissions affected?
No. application/x-www-form-urlencoded requests are not affected.
What version contains the fix?
The issue is fixed in Hono version 4.13.16.