Jan 28, 2026·5 min read·59 visits
Hono versions prior to 4.11.7 used a lazy regular expression to validate IPv4 addresses, accepting values > 255 in octets. When processed, these large values overflow into adjacent octets (e.g., `1.2.2.355` becomes `1.2.3.99`), allowing attackers to spoof trusted IPs or bypass blocklists.
A logic flaw in Hono's IP address validation middleware allows attackers to bypass IP-based access controls by supplying malformed IPv4 addresses that trigger an integer overflow during binary conversion.
Hono has built a reputation as the "Ultrafast" web framework for the edge, running on Cloudflare Workers, Deno, and Bun. It is sleek, minimal, and generally delightful to use. However, when you prioritize speed and minimalism, sometimes the boring, gritty details of input validation get glossed over.
In the world of middleware, the IP Restriction Middleware is the bouncer. It checks your ID (IP address) against a list of VIPs (allowlist) or troublemakers (blocklist). If the bouncer is doing their job, only the right people get in.
But in Hono versions prior to 4.11.7, the bouncer had a serious vision problem. They weren't checking if your ID was valid; they were just checking if it looked like an ID from a distance. This vulnerability isn't a complex memory corruption in C; it's a beautiful example of how loose Regular Expressions and loose typing in JavaScript can combine to create a perfect logic flaw.
The root of the issue lies in how Hono decided what constitutes a valid IPv4 address. You might expect a strict check ensuring four octets, each between 0 and 255. Instead, the developers used a regex that was... optimistic.
Here is the culprit found in src/utils/ipaddr.ts:
const IPV4_REGEX = /^[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}$/See the problem? [0-9]{0,3} matches any 0 to 3 digit number. That includes 0, 255, and unfortunately, 999. It creates a syntactic check (is it digit-dot-digit?) rather than a semantic check (is it a valid byte?).
If the validation stopped there, the application might just crash or throw an error when handling invalid IPs. But the second part of the flaw is how this string is converted into a number for comparison. Hono converts IPs to binary integers to perform fast CIDR matching. The math used to convert these octets assumed that no input would ever exceed 255. When that assumption fails, we enter the realm of integer overflows.
Let's look at the convertIPv4ToBinary function. This is where the magic happens—and by magic, I mean the unintended transmutation of numbers.
// The vulnerable logic
return (parts[0] << 24) + (parts[1] << 16) + (parts[2] << 8) + parts[3]In a strongly typed language, putting 355 into a uint8 container would throw an error or wrap around immediately. In JavaScript, parts[3] is just a number. If parts[3] is 355, it is added to the total sum.
Here is the kicker: parts[2] << 8 shifts the third octet 8 bits to the left. If parts[3] is larger than 255 (8 bits), it spills over into the space occupied by parts[2].
It is effectively performing addition where the developer intended concatenation. This allows an attacker to modify the third octet by overloading the fourth octet.
Let's construct a Proof of Concept. Suppose there is an internal admin panel allowlisted strictly for the IP 1.2.3.99. You are an attacker sitting at 1.2.2.x. You cannot natively change your IP to 1.2.3.99 without routing issues, but you can send a header (if the server trusts proxies) or spoof a packet that Hono interprets as the target.
We need to construct an IP 1.2.2.X that resolves to 1.2.3.99.
The Target:
Octet 3 = 3
Octet 4 = 99
The Input:
Octet 3 = 2
Octet 4 = ?
We need (2 << 8) + X to equal (3 << 8) + 99.
(3 * 256) + 99 = 768 + 99 = 867(2 * 256) = 512867 - 512 = 355So, if we send the IP 1.2.2.355:
The middleware sees 1.2.3.99, checks the allowlist, sees a match, and opens the door. You have successfully spoofed an IP address without actually spoofing any packets on the network layer.
The remediation is straightforward: stop accepting garbage input. The Hono team patched this in version 4.11.7 by replacing the lazy regex with a strict one that validates the 0-255 range.
Commit edbf6eea8e6c26a3937518d4ed91d8666edeec37 changes:
// The Fix
const IPV4_OCTET_PART = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])'
const IPV4_REGEX = new RegExp(`^(?:${IPV4_OCTET_PART}\\.){3}${IPV4_OCTET_PART}$`)This new regex explicitly matches:
250-255200-249100-1990-99By ensuring the octets never exceed 255 strictly at the parsing stage, the bitwise math downstream is safe from overflow. It is a classic example of "Input Validation 101": validate constraints at the boundary, not deep in the business logic.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Hono HonoJS | < 4.11.7 | 4.11.7 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-185 (Incorrect Regular Expression) |
| CVSS | 4.8 (Medium) |
| Attack Vector | Network |
| Impact | Security Bypass / IP Spoofing |
| Patch Commit | edbf6eea8e6c26a3937518d4ed91d8666edeec37 |
| Exploit Complexity | High (Requires knowledge of target IP/ACL) |
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.