Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
CRITICAL severity

@hypequery/clickhouse has SQL Injection in parameter escaping that allows arbitrary SQL executionGHSA-6wcc-39rp-hh9p

CRITICALFix: hypequery/hypequery#349

GHSA-6wcc-39rp-hh9p is a critical-severity (CVSS 9.8) SQL Injection vulnerability in @hypequery/clickhouse. A fix is available for @hypequery/clickhouse — see the affected versions and patch details below.

Also known asCVE-2026-54658
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 27, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
  • A successful exploit gives an attacker total control of the affected component, not partial access.
  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for GHSA-6wcc-39rp-hh9p.

EPSS Exploitation Probability

via FIRST.org ↗
0.8%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs57th percentile — riskier than 57% of all scored CVEsHighest risk
0.00%0.44%0.88%1.32%0.4%0.5%0.8%0.8%Aug 26Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

GHSA-6wcc-39rp-hh9p by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 396,966 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

0other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
@hypequery/clickhousenpm
24Kdownloads / week

Description

A SQL injection vulnerability exists in the escapeValue() function used for parameter substitution. escapeValue() dispatches on the type of the parameter value, and two of its branches failed to escape safely. An attacker who can control a parameter value can terminate the enclosing string literal and have the rest of the value parsed as SQL.

Vector 1 - string parameters. Fixed in 2.0.2. The string branch escaped ' as '' but left \\ untouched. ClickHouse honours C-style backslash escapes as well as SQL-standard quote doubling, so a value ending in an odd number of backslashes escapes the closing quote and the next parameter lands outside the literal:

where('a', 'eq', 'x\\')          ->   WHERE a = 'x\\' AND b = ' OR 1=1 --'

Vector 2 - object and array parameters. Fixed in 2.5.1, NOT in 2.0.2. The final branch of the same function rendered non-scalar values as `'${JSON.stringify(value)}'` with no escaping at all. JSON has no reason to escape the apostrophe, so any nested string containing ' terminates the literal:

where('meta', 'eq', { k: \"x' OR 1=1 -- \" })
                                ->   WHERE meta = '{\"k\":\"x' OR 1=1 -- \"}'

The 2.0.2 patch changed only the string branch and did not address this. Vector 2 remained exploitable in 2.0.2, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.3.0, 2.4.0 and 2.5.0 - every release this advisory previously reported as patched.

Who is impacted. Any application on a version below 2.5.1 that passes user-controlled input as a query parameter. Both vectors are reachable through the documented public API: .where(column, operator, value), the in operator, and adapter.render() / rawQuery().

Schema type declarations do not mitigate vector 2. createQueryBuilder().table() builds its state with an empty column map, so the filter validator has no declared type to check against and returns without validating. Even where a schema is supplied, only String, Int32, Int64, Float64 and Date columns are type-checked - Map, Array, Bool, UUID, DateTime, UInt*, Enum and Nullable columns are not - and any column name containing a . skips validation entirely.

Patches

Upgrade to 2.5.1 or later. Both vectors are closed there.

  • Vector 1 - fixed in 2.0.2 by 2dc1df7bae (the referenced 4dfa9d77 is the same change on the pull-request branch). Escapes backslashes before escaping single quotes.
  • Vector 2 - fixed in 2.5.1 by 2879161a81, which routes the serialised JSON back through escapeValue() so nested quotes are doubled. The same commit also rejects non-finite numbers and invalid Date values instead of emitting them into the query.

For anyone auditing the history: the vector-2 fix is bundled inside 2879161a81, whose commit message is "parenthesize logical groups in WHERE to preserve AND/OR precedence (#349)". Commit 4a1d4e38aa (#350), whose message does describe the escaping fix, changes only a bigint branch - the escaping fix is already present in its parent.

Workarounds

Upgrading is the only complete fix.

For vector 2 only, applications on 2.0.2–2.5.0 that cannot upgrade can serialise non-scalar parameters themselves and pass the resulting string. That routes the value through the string branch, which is correctly escaped from 2.0.2 onward:

.where('meta', 'eq', JSON.stringify(value))   // safe on >= 2.0.2

There is no workaround for vector 1 other than upgrading to 2.0.2 or later.

Do not substitute application-level input validation or sanitisation for either fix. Correct escaping depends on the literal context the library constructs, so the library has to own it.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npm@hypequery/clickhouseall versions2.5.1npm install @hypequery/clickhouse@2.5.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @hypequery/clickhouse, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update @hypequery/clickhouse to 2.5.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-6wcc-39rp-hh9p is resolved across your whole dependency graph.

  3. Workarounds

    Until you can upgrade, make sure every query built from user input uses parameterised statements or a prepared-statement API rather than string concatenation, and reduce the database account's privileges so an injected query cannot read or alter data beyond what the feature needs.

Frequently Asked Questions

A SQL injection vulnerability exists in the `escapeValue()` function used for parameter substitution. `escapeValue()` dispatches on the type of the parameter value, and two of its branches failed to escape safely. An attacker who can control a parameter value can terminate the enclosing string literal and have the rest of the value parsed as SQL. **Vector 1 - string parameters. Fixed in 2.0.2.** The string branch escaped `'` as `''` but left `\\` untouched. ClickHouse honours C-style backslash escapes as well as SQL-standard quote doubling, so a value ending in an odd number of backslashes es
O3 Security · Impact-Aware SCA

Is GHSA-6wcc-39rp-hh9p in your dependencies?

Find it across npm, including transitive dependencies.

@hypequery/clickhouse has SQL Injection in parameter…