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-54658

CVE-2026-54658: SQL Injection via Parameter Escaping Bypass in @hypequery/clickhouse

Alon Barad
Alon Barad
Software Engineer

Jul 29, 2026·5 min read·118 visits

Executive Summary (TL;DR)

Improper escaping of trailing backslash characters in @hypequery/clickhouse parameter substitution allows attackers to escape string literal boundaries and inject arbitrary SQL commands into ClickHouse queries.

A critical SQL injection vulnerability was identified in @hypequery/clickhouse prior to version 2.0.2. The escapeValue utility function in packages/clickhouse/src/core/utils.ts fails to escape literal backslash characters before replacing single quotes. This allows remote, unauthenticated attackers to supply input parameters ending in a backslash, neutralizing the closing quote character inside ClickHouse databases and enabling arbitrary SQL execution.

Vulnerability Overview

The node package @hypequery/clickhouse serves as an analytical query builder and semantic layer, translating structured object queries into ClickHouse-compatible SQL statements. Because ClickHouse often operates behind server-side APIs or is queried directly via HTTP, developer libraries typically rely on client-side parameter substitution to construct the final query string. This client-side execution path makes the query engine highly dependent on secure string-escaping utilities.

The core of this security mechanism resides in the escapeValue function within packages/clickhouse/src/core/utils.ts. This utility parses individual parameters and wraps strings in single quotes while escaping internal quotation marks. If an input value breaks these quotation boundaries, the parser shifts out of the string literal context and evaluates subsequent text as executable SQL structure.

In versions of @hypequery/clickhouse before 2.0.2, the library failed to sanitize literal backslash (\) characters during string preparation. Because ClickHouse supports C-style backslash escape sequences, an input ending with a backslash neutralizes the closing quote added by the library. This allows an attacker to construct queries that absorb application logic as a string literal, executing adjacent parameter values as raw SQL instructions.

Root Cause Analysis

The root cause of CVE-2026-54658 stems from a dialect mismatch between SQL-92 string-escaping conventions and ClickHouse's implementation of escape characters. Under standard SQL-92 specifications, a single quote within a string literal is escaped by doubling it (''), and backslashes have no syntactic function. However, the ClickHouse SQL parser supports C-style escapes, interpreting a backslash immediately preceding a single quote (\') as a literal single quote rather than a closing delimiter.

Prior to the patch, the escapeValue function processed string variables by replacing single quotes with doubled single quotes using the regex pattern value.replace(/'/g, "''"). No operations were performed to validate or escape literal backslash characters. When an input parameter such as test\ was passed, the utility produced the SQL literal 'test\''.

During parsing on the ClickHouse server, the sequence \' is read as an escaped quote. The string literal remains unclosed, causing the database to interpret all subsequent query components—including operators, commands, and structural clauses—as part of the string. The literal is only closed when the parser encounters the next unescaped single quote, which typically occurs in the next parameter, allowing the payload inside that parameter to execute as active SQL code.

Code Analysis and Security Patch

The vulnerability inside packages/clickhouse/src/core/utils.ts is shown below, illustrating the lack of backslash handling in the string classification block:

// Vulnerable Implementation (pre-2.0.2)
export function escapeValue(value: any): string {
  // ... types check
  else if (typeof value === 'string') {
    // Only single quotes are substituted, leaving backslashes unaltered
    return `'${value.replace(/'/g, "''")}'`;
  }
  // ...
}

To resolve this issue, commit 4dfa9d77d70a08b970e722268b75ca7d13db0bdf modified the string escaping logic. The updated code doubles all backslash characters before executing the single-quote replacement, neutralizing any attempts to escape the closing quote:

// Patched Implementation (2.0.2+)
export function escapeValue(value: any): string {
  else if (typeof value === 'number') {
    return value.toString();
  } else if (typeof value === 'string') {
    // Backslashes are doubled first to prevent escaping the closing quote
    const escaped = value.replace(/\\/g, '\\\\').replace(/'/g, "''");
    return `'${escaped}'`;
  } else if (value instanceof Date) {
    return `'${value.toISOString()}'`;
  } else {
    // ... fallback execution path
  }
}

While this patch successfully stops the trailing backslash attack vector, developers must ensure that fallback conditions do not introduce serialization bypasses. If an attacker can inject custom object types that bypass the typeof value === 'string' check but return malicious string values during execution, downstream vulnerabilities may persist. Strict input-type schema validation should be maintained on all upstream API endpoints.

Exploitation Methodology

Exploiting this vulnerability requires that an attacker can control at least one query parameter in a multi-parameter query, or control a parameter that precedes structurally predictable SQL operations. Consider a typical query constructed by the application interface to retrieve active database logs:

SELECT * FROM user_logs WHERE username = ? AND category = ?

An attacker supplies a single backslash \ as the first parameter, and the payload OR 1=1 -- as the second parameter. The query engine uses escapeValue to prepare both parameters, yielding the SQL query:

SELECT * FROM user_logs WHERE username = '\' AND category = ' OR 1=1 -- '

The ClickHouse engine parses the first string literal starting at the single quote before the backslash. Because of the trailing backslash, the single quote at the end of the first parameter is treated as an escaped literal quote. The string literal does not close until the single quote preceding OR 1=1 is encountered. Consequently, the string literal value becomes \\' AND category = , and the database parses and executes OR 1=1 -- as unescaped SQL commands.

Impact Assessment

The impact of CVE-2026-54658 is severe, with a CVSS v3.1 score of 9.8. Because @hypequery/clickhouse is commonly deployed in analytical servers and metrics pipelines, this vulnerability allows unauthenticated remote attackers to execute arbitrary SQL commands directly against backend data store instances.

Successful exploitation results in complete data confidentiality failure, allowing attackers to bypass application-level access controls and read sensitive table structures, system logs, or user credentials. Since ClickHouse supports administrative operations, an attacker can execute resource-heavy queries to trigger a denial of service, or execute destructive commands such as dropping tables and dropping databases, compromising the overall data integrity of the system.

Official Patches

hypequerySecurity Patch Commit
hypequeryGitHub Security Advisory
hypequeryRelease Page

Fix Analysis (1)

Technical Appendix

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

Affected Systems

@hypequery/clickhouse

Affected Versions Detail

Product
Affected Versions
Fixed Version
@hypequery/clickhouse
hypequery
< 2.0.22.0.2
AttributeDetail
CWE IDCWE-89
Attack VectorNetwork (AV:N)
CVSS Severity9.8 (Critical)
Exploit StatusPoC (Proof of Concept) available in repository tests
CISA KEV StatusNot listed
Mitigated Version2.0.2

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

The software constructs an SQL command using externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended SQL command when it is sent to the database.

Vulnerability Timeline

Security patch committed in GitHub repository
2026-06-08
GitHub Security Advisory GHSA-6wcc-39rp-hh9p published
2026-07-28
CVE-2026-54658 officially published
2026-07-28

References & Sources

  • [1]CVE Official Record
  • [2]GitHub Security Advisory GHSA-6wcc-39rp-hh9p
  • [3]Official Security Patch Commit
  • [4]Release Changelog
  • [5]Release Page

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

•26 minutes ago•CVE-2026-62683
3.1

CVE-2026-62683: Incorrect Authorization via Stale Public Shares in File Browser

File Browser versions prior to 2.63.17 contain an authorization and state-management flaw in the BoltDB storage backend. When an authenticated user deletes a shared directory via an HTTP request with a trailing slash (e.g., DELETE /api/resources/a/), the share cleanup routine queries the database index using the unnormalized path before stripping the trailing slash. Because canonical share paths are stored without trailing slashes (e.g., /a), the database prefix query fails to match the parent directory share record. If a directory with the same name is later recreated, the dormant public share hash automatically reactivates and exposes the new directory contents to unauthenticated users.

Alon Barad
Alon Barad
1 views•10 min read
•about 1 hour ago•CVE-2026-62297
7.5

CVE-2026-62297: Uncontrolled Memory Allocation and Denial of Service in ag-psd

An uncontrolled memory allocation vulnerability exists in ag-psd versions prior to 31.0.0. When parsing Adobe Photoshop Document (PSD) files, the readPsd() function reads image dimensions and color depth directly from the file header and allocates off-heap typed arrays without validating whether the requested memory size is proportional to the input stream or bounded by operational thresholds. An unauthenticated attacker can supply a crafted 52-byte PSD payload that triggers an immediate 3.35 GB memory allocation, resulting in process termination via the operating system Out-Of-Memory (OOM) killer.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 2 hours ago•CVE-2026-126297
7.5

CVE-2026-126297: Algorithmic Complexity Denial of Service in NLTK ConllCorpusReader

CVE-2026-126297 (GHSA-v8f3-6phw-6mh9) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Natural Language Toolkit (NLTK) prior to version 3.10.4. Located in the Semantic Role Labeling (SRL) parser within `nltk/corpus/reader/conll.py`, the flaw allows an attacker to trigger quadratic O(N^2) CPU processing overhead by providing crafted CoNLL-formatted corpus inputs containing decoy span columns or nested full-width verb spans. Applications parsing untrusted linguistic corpora can experience prolonged CPU exhaustion and application-level Denial of Service (DoS).

Amit Schendel
Amit Schendel
3 views•12 min read
•about 3 hours ago•CVE-2026-126298
7.5

CVE-2026-126298: Quadratic Algorithmic Complexity Denial of Service in NLTK Tree.chomsky_normal_form

CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.

Alon Barad
Alon Barad
6 views•12 min read
•about 4 hours ago•CVE-2026-126299
7.5

CVE-2026-126299: Quadratic Algorithmic Complexity Denial of Service in NLTK CCG Lexicon Parser

An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.

Alon Barad
Alon Barad
5 views•10 min read
•about 5 hours ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
2 views•11 min read