Hono validators need a canonical content-type boundary

Hono applications often rely on validator('json') or validator('form') to decide which request fields reach a handler. CVE-2026-137485 shows why that decision must use the same parsed body that the handler later reads.

Red Hat's advisory describes Hono 4.5.1 through versions before 4.13.18 as vulnerable to a validation bypass. An unauthenticated request can alter Content-Type parameters, including whitespace before a semicolon, a trailing semicolon, or an underscored parameter name. The validator then receives an empty object while the handler still reads the rejected fields.

The defect is a parser disagreement. One part of the application treats a malformed media type as one thing; the validator treats it as another; and the handler makes a third decision. Security checks fail when the validator sees a harmless empty body and the route processes different data.

The impact depends on what the route does after validation. A login route might process unexpected account fields. An upload route might act on a different filename or content class. A webhook might accept a payload that should have failed schema checks. The CVE alone does not prove those outcomes, but it gives an attacker a way to cross a validation boundary without authentication.

Administrators should upgrade to Hono 4.13.18 or later. Application teams should also test media types with parameters rather than checking only application/json. Useful cases include mixed-case parameter names, whitespace around delimiters, duplicate parameters, trailing semicolons and malformed form types.

The defensive rule is simple: parse once, validate the parsed value, and pass that exact value to the handler. A route should not parse raw input again after a validator accepts it. If the framework cannot guarantee that contract, middleware should reject unknown media-type parameters and unsupported syntax before route logic runs.

Logging should preserve the raw Content-Type and a hash or normalized form of the validated body. An empty validator result followed by a populated handler is a strong signal for investigation. This is especially relevant on routes that combine schema validation with role checks, file paths or billing actions.

The patch closes the known parser mismatch, but it does not make every validator policy safe. Teams should inventory routes that trust validator output for authorization decisions. A schema that allows extra properties can still produce a logic error even after the CVE is fixed.

References