CVE-2024-32652: @hono/node server Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-hgxw-5xg3-69jx
CVSS 7.5
CWE-755
Published
Advisory Summary

CVE-2024-32652 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting @hono/node server libraries in the npm ecosystem. The issue involves @hono/node-server has denial of service risk when receiving host header that cannot be parsed. Remediation is available by upgrading affected packages to version 1.10.1.

CVE-2024-32652 at a Glance

CVE Identifier CVE-2024-32652
GHSA Identifier GHSA-hgxw-5xg3-69jx
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product @hono/node server
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2024-32652

To remediate this vulnerability, upgrade all affected @hono/node server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@hono/node-server fixed: 1.10.1
npm install @hono/node-server@1.10.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @hono/node-server

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-32652, inspect your project dependencies using npm:

npm ls @hono/node-server

Analyze the terminal output to locate any version of @hono/node server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.1), your application is affected.

Note: The npm ls @hono/node-server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In @hono/node server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The application hangs when receiving a Host header with a value that `@hono/node-server` can't handle well. Invalid values are those that cannot be parsed by the `URL` as a hostname such as an empty string, slashes `/`, and other strings. For example, if you have a simple application: ```ts import { serve } from '@hono/node-server' import { Hono } from 'hono' const app = new Hono() app.get('/', (c) => c.text('Hello')) serve(app) ``` Sending a request with a Host header with an empty value to it: ``` curl localhost:3000/ -H "Host: " ``` The results: ``` node:internal/url:775 this.#updateContext(bindingUrl.parse(input, base)); ^ TypeError: Invalid URL at new URL (node:internal/url:775:36) at newRequest (/Users/yusuke/work/h/159/node_modules/@hono/node-server/dist/index.js:137:17) at Server.<anonymous> (/Users/yusuke/work/h/159/node_modules/@hono/node-server/dist/index.js:399:17) at Server.emit (node:events:514:28) at Server.emit (node:domain:488:12) at parserOnIncoming (node:_http_server:1143:12) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) { code: 'ERR_INVALID_URL', input: 'http:///' } ``` ### Patches The version `1.10.1` includes the fix for this issue. But, you should use `1.11.0`, which has other fixes related to this issue. https://github.com/honojs/node-server/issues/160 https://github.com/honojs/node-server/issues/161 ### Workarounds Nothing. Upgrade your `@hono/node-server`. ### References https://github.com/honojs/node-server/issues/159

CVE-2024-32652 Affected @hono/node server Versions

1 component(s)
Fixed Versions:
1.10.1
Product / Package Ecosystem Affected Versions Fixed Version
@hono/node-server
npm
≥ 1.3.0
< 1.10.1
1.10.1

References

Frequently Asked Questions

What is CVE-2024-32652?
CVE-2024-32652 is a security vulnerability in @hono/node server involving @hono/node-server has Denial of Service risk when receiving Host header that cannot be parsed under CWE-755: Improper Handling of Exceptional Conditions.
Which @hono/node server versions are affected?
Affected versions include releases prior to 1.10.1 across affected packages: @hono/node-server.
What version fixes CVE-2024-32652?
Upgrading to 1.10.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @hono/node-server affected?
Yes, @hono/node-server is affected in releases prior to 1.10.1. Upgrade your dependency to 1.10.1 or later.
What is the CVSS score of CVE-2024-32652?
CVE-2024-32652 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-32652?
CVE-2024-32652 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check npm dependencies for CVE-2024-32652?
Run the dependency tree command: 'npm ls @hono/node-server'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hgxw-5xg3-69jx",
  "modified" : "2024-04-19T21:44:10Z",
  "published" : "2024-04-19T19:48:40Z",
  "aliases" : [ "CVE-2024-32652" ],
  "summary" : "@hono/node-server has Denial of Service risk when receiving Host header that cannot be parsed",
  "details" : "### Impact\n\nThe application hangs when receiving a Host header with a value that `@hono/node-server` can't handle well. Invalid values are those that cannot be parsed by the `URL` as a hostname such as an empty string, slashes `/`, and other strings.\n\nFor example, if you have a simple application:\n\n```ts\nimport { serve } from '@hono/node-server'\nimport { Hono } from 'hono'\n\nconst app = new Hono()\n\napp.get('/', (c) => c.text('Hello'))\n\nserve(app)\n```\n\nSending a request with a Host header with an empty value to it:\n\n```\ncurl localhost:3000/ -H \"Host: \"\n```\n\nThe results:\n\n```\nnode:internal/url:775\n    this.#updateContext(bindingUrl.parse(input, base));\n                                   ^\n\nTypeError: Invalid URL\n    at new URL (node:internal/url:775:36)\n    at newRequest (/Users/yusuke/work/h/159/node_modules/@hono/node-server/dist/index.js:137:17)\n    at Server.<anonymous> (/Users/yusuke/work/h/159/node_modules/@hono/node-server/dist/index.js:399:17)\n    at Server.emit (node:events:514:28)\n    at Server.emit (node:domain:488:12)\n    at parserOnIncoming (node:_http_server:1143:12)\n    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) {\n  code: 'ERR_INVALID_URL',\n  input: 'http:///'\n}\n```\n\n### Patches\n\nThe version `1.10.1` includes the fix for this issue. But, you should use `1.11.0`, which has other fixes related to this issue. https://github.com/honojs/node-server/issues/160 https://github.com/honojs/node-server/issues/161\n\n### Workarounds\n\nNothing. Upgrade your `@hono/node-server`.\n\n### References\n\nhttps://github.com/honojs/node-server/issues/159\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@hono/node-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.3.0"
      }, {
        "fixed" : "1.10.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/honojs/node-server/security/advisories/GHSA-hgxw-5xg3-69jx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32652"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/honojs/node-server/issues/159"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/honojs/node-server/issues/161"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/honojs/node-server/commit/306d98f02a8671a0a1fb91ac8fe7e281690c05af"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/honojs/node-server/commit/d847e60249fd8183ba0998bc379ba20505643204"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/honojs/node-server"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-755" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-19T19:48:40Z",
    "nvd_published_at" : "2024-04-19T19:15:07Z"
  }
}