Aug 8, 2026·5 min read·34 visits
Unauthenticated remote attackers can cause complete Denial of Service (DoS) in Hono applications running versions 4.12.0 to 4.12.33 by sending excessively long hyphen-separated language strings in headers, cookies, or query parameters.
An Algorithmic Complexity Denial of Service (DoS) vulnerability exists in the Hono web application framework within its languageDetector middleware. From version 4.12.0 to 4.12.33, the progressive language-tag truncation routine (normalizeLanguage) performs string operations with a quadratic time complexity O(N^2) relative to the number of hyphen-separated subtags in the user-supplied language tag. This allows an unauthenticated remote attacker to cause resource exhaustion and CPU spikes, resulting in a full denial of service of the single-threaded JavaScript runtime.
The Hono web application framework provides a languageDetector middleware designed to parse language tags and match client preferences against a developer-defined array of supported languages. This functionality is crucial for internationalization, allowing applications to dynamically serve content customized to the locale of the user.
Within Hono versions 4.12.0 through 4.12.33, the language detection routine implements a progressive truncation mechanism to resolve language matches. This routine exposes an attack surface where an unauthenticated remote attacker can supply a crafted language tag to trigger high resource consumption.
The underlying vulnerability is classified as an Algorithmic Complexity Denial of Service (CWE-407). It occurs when the progressive truncation routine processes incoming language tags containing an excessively large number of hyphen-separated subtags, leading to extreme CPU utilization and blocking behavior.
The root cause of this vulnerability lies in the implementation of the language-tag progressive truncation algorithm in src/middleware/language/language.ts. When a client requests a specific locale, such as en-US-POSIX, the middleware evaluates candidate prefixes by iteratively stripping the right-most subtag to match against developer-defined supported languages.
To perform this operation, the code splits the user-controlled input string compLang into an array using the hyphen delimiter. It then loops backward through this array, performing slice and join operations in each iteration to generate candidate strings. These candidates are subsequently looked up in the supported languages array using indexOf.
This specific sequence of operations introduces a quadratic time complexity O(N^2), where N represents the number of hyphenated segments in the input string. Because JavaScript runtimes operate on a single-threaded event loop, executing hundreds of thousands of string copying and concatenation operations synchronously halts all execution. As a result, the entire server process becomes unresponsive to concurrent HTTP traffic while processing a single malicious request.
To understand the technical mechanics of the flaw, compare the vulnerable implementation with the patched version. The vulnerable implementation in versions 4.12.0 through 4.12.33 relies on an input-driven loop:
// Vulnerable Implementation
const parts = compLang.split('-')
for (let i = parts.length - 1; i > 0; i--) {
// O(i) slice and O(i) join operations within a loop of length N
const candidate = parts.slice(0, i).join('-')
const prefixIndex = compSupported.indexOf(candidate)
if (prefixIndex !== -1) {
return options.supportedLanguages[prefixIndex]
}
}The patched version, implemented in commit f70e2c31684387b3231cc38512a31df6ca76a1c7, reverses the evaluation direction. Instead of truncating the user input, the routine loops over the static, developer-defined array of supported languages:
// Patched Implementation in v4.12.34
let longestMatchIndex = -1
let longestMatchLength = -1
for (let i = 0; i < compSupported.length; i++) {
const candidate = compSupported[i]
if (
candidate.length < compLang.length &&
candidate.length > longestMatchLength &&
compLang.startsWith(candidate) &&
compLang[candidate.length] === '-'
) {
longestMatchIndex = i
longestMatchLength = candidate.length
}
}
if (longestMatchIndex !== -1) {
return options.supportedLanguages[longestMatchIndex]
}This architectural shift bounds the computational complexity to O(M * L), where M is the number of supported languages and L is the length of the matching prefix. Because the developer controls the size of M, the execution time remains small and independent of the attacker's input length.
Exploitation of CVE-2026-71848 requires no privileges or special authentication state. An attacker needs network access to any endpoint exposing the languageDetector middleware. By default, the middleware parses the query string parameter lang, cookies, or the Accept-Language HTTP header, meaning any of these vectors can be utilized.
The payload is constructed by concatenating a single-character subtag with a hyphen repeatedly. For example, a payload sequence such as x- repeated 30,000 times generates a string of 60,000 characters with 30,000 individual segments.
When sent to the target server via curl or fetch, this payload forces the underlying V8 or JavaScript runtime to execute approximately 450 million iterations of copying and joining operations. This blocks the main thread for several seconds, dropping the server's availability to zero for all other clients during that execution window.
The security impact of this vulnerability is a complete Denial of Service (DoS) for the affected service instance. Because Hono is highly optimized for serverless, edge, and containerized environments, the severity of the impact depends on the hosting runtime environment.
In containerized and persistent server environments (such as Node.js or Bun running on virtual machines or Kubernetes), a continuous stream of such requests will saturate the server's CPU. This results in prolonged downtime and forces manual scaling or service restarts to recover availability.
In serverless environments (such as Cloudflare Workers or AWS Lambda), individual execution limits or timeout thresholds may terminate the blocked worker. However, this still leads to increased latency, potential cost inflation due to CPU usage bills, and localized denial of service during execution peaks.
The recommended remediation is to upgrade the Hono framework dependency to version 4.12.34 or later. This replaces the vulnerable loop with the safer configuration-driven prefix checking routine.
For environments where immediate upgrading is not possible, security teams should implement edge-level mitigations. Specifically, configure web application firewalls (WAF) or reverse proxies to enforce limits on maximum header sizes and query string lengths.
Additionally, a custom regex rule can be deployed at the API gateway to filter out incoming requests containing excessive hyphenated patterns. A rule pattern such as ([a-zA-Z0-9]+-){50,} can effectively detect and drop anomalous language strings before they reach the Node.js or serverless execution layer.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
hono honojs | >= 4.12.0, <= 4.12.33 | 4.12.34 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-407 (Inefficient Algorithmic Complexity) |
| Attack Vector | Network (AV:N) |
| CVSS Score | 5.3 |
| Exploit Status | Proof of Concept (PoC) available |
| KEV Status | Not Listed |
| Impact | Denial of Service (DoS) |
The program uses an algorithm with an inefficient complexity that can be triggered by a specific input, leading to excessive CPU consumption.
An uncontrolled resource consumption vulnerability exists in the Docling document conversion library. Maliciously structured HTML, JATS, ODS, or BoxNote inputs containing table cells with excessively large 'rowspan' or 'colspan' attribute values trigger algorithmic complexity conditions. This allows unauthenticated remote attackers to initiate resource exhaustion states, crashing or hanging the target document processing pipeline while bypassing configured timeouts.
A Local File Inclusion (LFI) and Arbitrary File Disclosure vulnerability exists in Docling and Docling Slim versions >= 2.16.0 up to 2.131.0. When parsing serialized DoclingDocument structures using the JSON input format, the backend fails to restrict image URI schemes, allowing remote attackers to retrieve local files and verify path existence on the host system during embedded document export.
Docling, a tool for parsing and processing diverse document formats, is vulnerable to arbitrary file read, arbitrary file write, and potential remote code execution (RCE) in versions 2.94.0 through 2.131.0. The vulnerability occurs when applications configure Docling to use the Tectonic engine for rendering TikZ diagrams into images. Because the compilation did not restrict hazardous TeX primitives or sandbox the environment, an attacker can supply crafted documents containing malicious TikZ definitions to access or modify local files and execute arbitrary commands under the privileges of the processing application.
An SSRF guard bypass vulnerability in the Docling document conversion engine allows unauthenticated attackers to bypass internal IP access controls. The vulnerability exists due to a DNS rebinding Time-of-Check Time-of-Use (TOCTOU) condition, URL authority parsing inconsistencies, and unvalidated network requests triggered during headless browser page rendering.
A technical analysis of CVE-2026-105742 (GHSA-p3fw-7699-7926), a sensitive information disclosure vulnerability in the Docling document processing library. Vulnerable versions of Docling indiscriminately forward custom HTTP headers, such as authentication tokens, to arbitrary third-party origins and during cross-origin redirects while fetching remote image assets from untrusted HTML and EPUB documents.
CVE-2026-106121 is a Denial of Service (DoS) vulnerability in the RabbitMQ Java Client library (amqp-client) affecting versions prior to 5.37.0. The vulnerability resides in the legacy, custom JSON-RPC parsing class com.rabbitmq.tools.json.JSONReader. When parsing malformed or truncated payloads ending within a quoted string or single-line comment, the parser's scanner enters an infinite loop. This occurs because the loop lacks an exit condition for the end-of-input sentinel character returned by the iterator, leading to either CPU exhaustion or a JVM crash from an OutOfMemoryError.