Summary
IP Restriction Middleware in Hono is vulnerable to an IP address validation bypass. The IPV4_REGEX pattern and convertIPv4ToBinary function in src/utils/ipaddr.ts do not properly validate that IPv4 octet values are within the valid range of 0-255, allowing attackers to craft malformed IP addresses that bypass IP-based access controls.
Details
The vulnerability exists in two components:
- Permissive regex pattern: The
IPV4_REGEX (/^[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}$/)accepts octet values greater than 255 (e.g.,999). - Unsafe binary conversion: The
convertIPv4ToBinaryfunction does not validate octet ranges before performing bitwise operations. When an octet exceeds 255, it overflows into adjacent octets during the bit-shift calculation.
For example, the IP address 1.2.2.355 is accepted and converts to the same binary value as 1.2.3.99:
355=256 + 99=0x163- After bit-shifting:
(1 << 24) + (2 << 16) + (2 << 8) + 355=0x01020363=1.2.3.99
Affected Components
- IP Restriction Middleware
src/utils/ipaddr.ts:IPV4_REGEX,convertIPv4ToBinary,distinctRemoteAddr
Impact
An attacker can bypass IP-based restrictions by crafting malformed IP addresses:
- Blocklist bypass: If
1.2.3.0/24is blocked, an attacker can use1.2.2.355(or similar) to bypass the restriction. - Allowlist bypass: Requests from unauthorized IP ranges may be incorrectly permitted.
This is exploitable when the application relies on client-provided IP addresses (e.g., X-Forwarded-For header) for access control decisions.
CVE-2026-24398 has a CVSS score of 4.8 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.11.7); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-24398? CVE-2026-24398 is a medium-severity security vulnerability in hono (npm), affecting versions < 4.11.7. It is fixed in 4.11.7.
- How severe is CVE-2026-24398? CVE-2026-24398 has a CVSS score of 4.8 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of hono are affected by CVE-2026-24398? hono (npm) versions < 4.11.7 is affected.
- Is there a fix for CVE-2026-24398? Yes. CVE-2026-24398 is fixed in 4.11.7. Upgrade to this version or later.
- Is CVE-2026-24398 exploitable, and should I be worried? Whether CVE-2026-24398 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-24398 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-24398? Upgrade
honoto 4.11.7 or later.