CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-71848

CVE-2026-71848: Algorithmic Complexity Denial of Service in Hono languageDetector Middleware

Alon Barad
Alon Barad
Software Engineer

Aug 8, 2026·5 min read·46 visits

Executive Summary (TL;DR)

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.

Vulnerability Overview

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.

Root Cause Analysis

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.

Code Analysis

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 Methodology

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.

Impact Assessment

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.

Remediation and Long-Term Security

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.

Fix Analysis (1)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Affected Systems

Hono Framework languageDetector Middleware

Affected Versions Detail

Product
Affected Versions
Fixed Version
hono
honojs
>= 4.12.0, <= 4.12.334.12.34
AttributeDetail
CWE IDCWE-407 (Inefficient Algorithmic Complexity)
Attack VectorNetwork (AV:N)
CVSS Score5.3
Exploit StatusProof of Concept (PoC) available
KEV StatusNot Listed
ImpactDenial of Service (DoS)

MITRE ATT&CK Mapping

T1499.003Endpoint Denial of Service: Application Exhaustion
Impact
CWE-407
Inefficient Algorithmic Complexity

The program uses an algorithm with an inefficient complexity that can be triggered by a specific input, leading to excessive CPU consumption.

References & Sources

  • [1]GitHub Security Advisory GHSA-54fx-42gc-7vw4
  • [2]Fix Commit f70e2c316
  • [3]Hono v4.12.34 Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 17 hours ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

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.

Alon Barad
Alon Barad
4 views•10 min read
•about 18 hours ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

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.

Alon Barad
Alon Barad
6 views•12 min read
•about 19 hours ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

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.

Alon Barad
Alon Barad
5 views•12 min read
•about 20 hours ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

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.

Amit Schendel
Amit Schendel
10 views•10 min read
•about 21 hours ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

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.

Alon Barad
Alon Barad
12 views•10 min read
•about 22 hours ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

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.

Amit Schendel
Amit Schendel
6 views•9 min read