hono@4.13.15

Web framework built on Web Standards

  • latest version

    4.13.19

  • latest non vulnerable version

  • first published

    4 years ago

  • latest version published

    3 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the hono package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    Insufficiently Controlled Parser Differential

    hono is an Ultrafast web framework for the Edges

    Affected versions of this package are vulnerable to Insufficiently Controlled Parser Differential via the multipartRegex pattern in src/validator/validator.ts, which only matches a multipart/form-data Content-Type carrying exactly one boundary parameter. When a request includes any additional legal parameter (such as charset) or extra whitespace after the ;, the regex fails to match, causing the validator('form') middleware to pass an empty object to the validation callback instead of the parsed form fields. 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(), effectively bypassing any allow-list or required-field checks the validator was intended to enforce.

    Note: This is only exploitable when the application uses validator('form') with multipart/form-data requests and the validation callback does not explicitly reject an empty object.

    How to fix Insufficiently Controlled Parser Differential?

    Upgrade hono to version 4.13.16 or higher.

    >=4.5.1 <4.13.16
    • M
    Authentication Bypass Using an Alternate Path or Channel

    hono is an Ultrafast web framework for the Edges

    Affected versions of this package are vulnerable to Authentication Bypass Using an Alternate Path or Channel via two flaws in the path-prefix stripping logic of mount() and app.mount(). First, when a dynamic mount prefix such as /api/:tenant/* is used, the prefix is removed by the length of the route pattern string rather than the length of the matched prefix, so a request like /api/a/xxxxx/admin/secret is forwarded to the mounted application as /admin/secret. Second, since 4.12.21, the forwarded path is built from the decoded request path and assigned to url.pathname, which causes a decoded backslash to be normalized to / and .. sequences to be collapsed, so /app/public%5C..%5Cadmin/secret also reaches the mounted application as /admin/secret. In both cases the outer application routes on the original path, so path-scoped middleware such as an authentication check on /app/admin/* does not run, and an unauthenticated client can reach protected routes of the mounted application.

    Note: This is only exploitable when mount() or app.mount() is used and authentication or authorization middleware is registered on a sub-path inside the mount prefix in the outer application.

    How to fix Authentication Bypass Using an Alternate Path or Channel?

    Upgrade hono to version 4.13.16 or higher.

    <4.13.16
    • L
    Cross-site Scripting (XSS)

    hono is an Ultrafast web framework for the Edges

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the css helper in hono/css, which escapes </ sequences only within individual interpolated values and not across template boundaries. When the template literal or a preceding interpolated value ends with < and the next interpolated value starts with /style>, the combined output contains an unescaped </style> closing tag. During server-side rendering, this causes the <Style /> element to close early and the remainder of the value to be interpreted as HTML, allowing an attacker who controls the interpolated string to inject arbitrary HTML, including script elements, into the rendered page.

    Note: This is only exploitable when < is the last character before an interpolation in a css template (either in the template literal itself or supplied by a preceding interpolated value) and the subsequent interpolated value is attacker-controlled.

    How to fix Cross-site Scripting (XSS)?

    Upgrade hono to version 4.13.16 or higher.

    >=3.12.0 <4.13.16
    • M
    Incorrect Authorization

    hono is an Ultrafast web framework for the Edges

    Affected versions of this package are vulnerable to Incorrect Authorization via RegExpRouter in three distinct cases where wildcard middleware is silently skipped, allowing a request to reach a route handler or the not-found handler without the authentication or authorization middleware registered on a wildcard path. In case 1, middleware whose parameter uses an explicit default pattern such as /api/:tenant{[^/]+}/admin/* is not applied to a route written as /api/:tenant/admin/:id. In case 2, middleware on /admin/* is not applied to a route registered on /admin* for paths under /admin/. In case 3, a path containing an encoded line terminator (%0A, %0D, %E2%80%A8, or %E2%80%A9) matches no wildcard pattern, so the request bypasses all wildcard middleware entirely.

    Note: This is only exploitable when the application uses RegExpRouter directly or through the default SmartRouter, and relies on wildcard middleware for authentication or authorization.

    How to fix Incorrect Authorization?

    Upgrade hono to version 4.13.16 or higher.

    >=4.1.4 <4.13.16
    • M
    Cross-site Request Forgery (CSRF)

    hono is an Ultrafast web framework for the Edges

    Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) via the csrf() middleware's failure to validate requests with Content-Type: text/ping. The middleware only performs origin checks when the content type matches one of the three types an HTML form can send. Chromium's hyperlink auditing (<a ping>) sends a credentialed cross-origin POST with Content-Type: text/ping and no CORS preflight, which the middleware passes directly to the handler without evaluating the Origin or Sec-Fetch-Site headers. An attacker can therefore host a page that causes a visiting user in Chrome or Edge to trigger state-changing POST requests - such as logging out, deleting a resource, or toggling a setting - against any application protected by csrf(), provided the request body content is irrelevant to the action.

    Note: This is only exploitable against endpoints whose effect does not depend on the request body, and requires the user's session cookie to be sent with the request (default SameSite=Lax permits this from a same-site origin, or when cookies are set with SameSite=None).

    How to fix Cross-site Request Forgery (CSRF)?

    Upgrade hono to version 4.13.16 or higher.

    <4.13.16