{"id":"GHSA-6wcc-39rp-hh9p","revision":null,"records":[{"revision":"a0249831d8934d108dda412b6c0c56f2","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-54658","aliases":[],"title":"@hypequery/clickhouse has SQL Injection in parameter escaping that allows arbitrary SQL execution","description":"Hypequery is a TypeScript semantic layer for ClickHouse. Prior to 2.5.1, escapeValue() in packages/clickhouse/src/core/utils.ts did not escape backslashes before single quotes during parameter substitution, allowing attacker controlled query parameters with a trailing backslash to escape the closing quote and inject arbitrary SQL. This issue is fixed in version 2.0.2. Version 2.0.2 fixes string parameters, while version 2.5.1 fixes all known vectors. Upgrading to 2.5.1 or later is the only complete fix. In versions 2.0.2 through 2.5.0, serializing non-scalar parameters with \u00A0JSON.stringify()\u00A0 before passing them is a workaround for the object/array vector only.","state":0,"publishedAt":"2026-07-28T22:18:48.8+00:00","modifiedAt":"2026-08-04T20:39:44.798+00:00","affected":[{"ecosystem":"Vendor product","name":"hypequery","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"hypequery\",\n                    \"product\": \"hypequery\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 2.5.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"severity":"CRITICAL"}],"references":["https://github.com/hypequery/hypequery/security/advisories/GHSA-6wcc-39rp-hh9p","https://github.com/hypequery/hypequery/pull/349","https://github.com/hypequery/hypequery/commit/2879161a810fed2c2222f785816ff05510976960","https://github.com/hypequery/hypequery/commit/2dc1df7bae","https://github.com/hypequery/hypequery/commit/4dfa9d77d70a08b970e722268b75ca7d13db0bdf","https://github.com/hypequery/hypequery/blob/main/packages/clickhouse/CHANGELOG.md#202","https://github.com/hypequery/hypequery/releases/tag/@hypequery/clickhouse@2.0.2","https://github.com/hypequery/hypequery/releases/tag/@hypequery/clickhouse@2.5.1"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-54658","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-54658","identifiers":["CVE-2026-54658"]},"retained":false,"historicalAffected":[]},{"revision":"5d91424675d84a76af316919d6ee2b8a","observedAt":"2026-11-21T17:19:22.853+00:00","statement":{"source":"euvd","id":"EUVD-2026-50086","aliases":["CVE-2026-54658","GHSA-6wcc-39rp-hh9p"],"title":"Hypequery is a TypeScript semantic layer for ClickHouse. Prior to 2.5.1, escapeValue() in packages/clickhouse/src/core/utils.ts did not escape backslashes before single quotes during parameter substitution, allowing attacker controlled quer…","description":"Hypequery is a TypeScript semantic layer for ClickHouse. Prior to 2.5.1, escapeValue() in packages/clickhouse/src/core/utils.ts did not escape backslashes before single quotes during parameter substitution, allowing attacker controlled query parameters with a trailing backslash to escape the closing quote and inject arbitrary SQL. This issue is fixed in version 2.0.2. Version 2.0.2 fixes string parameters, while version 2.5.1 fixes all known vectors. Upgrading to 2.5.1 or later is the only complete fix. In versions 2.0.2 through 2.5.0, serializing non-scalar parameters with \u00A0JSON.stringify()\u00A0 before passing them is a workaround for the object/array vector only.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"severity":null}],"references":["https://github.com/hypequery/hypequery/security/advisories/GHSA-6wcc-39rp-hh9p","https://github.com/hypequery/hypequery/pull/349","https://github.com/hypequery/hypequery/commit/2879161a810fed2c2222f785816ff05510976960","https://github.com/hypequery/hypequery/commit/2dc1df7bae","https://github.com/hypequery/hypequery/commit/4dfa9d77d70a08b970e722268b75ca7d13db0bdf","https://github.com/hypequery/hypequery/blob/main/packages/clickhouse/CHANGELOG.md#202","https://github.com/hypequery/hypequery/releases/tag/@hypequery/clickhouse@2.0.2","https://github.com/hypequery/hypequery/releases/tag/@hypequery/clickhouse@2.5.1"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-50086","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Jul 28, 2026, 10:18:48 PM","dateUpdated":"Aug 4, 2026, 8:39:44 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-50086","identifiers":["EUVD-2026-50086","CVE-2026-54658","GHSA-6wcc-39rp-hh9p"]},"retained":false,"historicalAffected":[]},{"revision":"2878bcdf1a4045ce974bd5dd47857b90","observedAt":"2026-10-25T13:17:28.253+00:00","statement":{"source":"nvd","id":"CVE-2026-54658","aliases":[],"title":"Hypequery is a TypeScript semantic layer for ClickHouse. Prior to 2.5.1, escapeValue() in packages/clickhouse/src/core/utils.ts did not escape backslashes before single quotes during parameter substitution, allowing attacker controlled quer…","description":"Hypequery is a TypeScript semantic layer for ClickHouse. Prior to 2.5.1, escapeValue() in packages/clickhouse/src/core/utils.ts did not escape backslashes before single quotes during parameter substitution, allowing attacker controlled query parameters with a trailing backslash to escape the closing quote and inject arbitrary SQL. This issue is fixed in version 2.0.2. Version 2.0.2 fixes string parameters, while version 2.5.1 fixes all known vectors. Upgrading to 2.5.1 or later is the only complete fix. In versions 2.0.2 through 2.5.0, serializing non-scalar parameters with \u00A0JSON.stringify()\u00A0 before passing them is a workaround for the object/array vector only.","state":0,"publishedAt":"2026-07-28T23:17:08.913+00:00","modifiedAt":"2026-08-04T21:16:36.853+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"severity":"CRITICAL"}],"references":["https://github.com/hypequery/hypequery/blob/main/packages/clickhouse/CHANGELOG.md#202","https://github.com/hypequery/hypequery/commit/2879161a810fed2c2222f785816ff05510976960","https://github.com/hypequery/hypequery/commit/2dc1df7bae","https://github.com/hypequery/hypequery/commit/4dfa9d77d70a08b970e722268b75ca7d13db0bdf","https://github.com/hypequery/hypequery/pull/349","https://github.com/hypequery/hypequery/releases/tag/@hypequery/clickhouse@2.0.2","https://github.com/hypequery/hypequery/releases/tag/@hypequery/clickhouse@2.5.1","https://github.com/hypequery/hypequery/security/advisories/GHSA-6wcc-39rp-hh9p"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-54658","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-89"],"productCriteria":[],"sourceDates":{"published":"2026-07-28T23:17:08.913","lastModified":"2026-08-04T21:16:36.853"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-54658","identifiers":["CVE-2026-54658"]},"retained":false,"historicalAffected":[]},{"revision":"ae5d0fe31a474422a302bc32e4eef494","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-6wcc-39rp-hh9p","aliases":["CVE-2026-54658"],"title":"@hypequery/clickhouse has SQL Injection in parameter escaping that allows arbitrary SQL execution","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.\n\n**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:\n\n```\nwhere('a', 'eq', 'x\\\\')          ->   WHERE a = 'x\\\\' AND b = ' OR 1=1 --'\n```\n\n**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:\n\n```\nwhere('meta', 'eq', { k: \\\"x' OR 1=1 -- \\\" })\n                                ->   WHERE meta = '{\\\"k\\\":\\\"x' OR 1=1 -- \\\"}'\n```\n\nThe 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.\n\n**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()`.\n\n**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.\n\n## Patches\n\nUpgrade to **2.5.1 or later**. Both vectors are closed there.\n\n- **Vector 1** - fixed in **2.0.2** by `2dc1df7bae` (the referenced `4dfa9d77` is the same change\n  on the pull-request branch). Escapes backslashes before escaping single quotes.\n- **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.\n\nFor 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.\n\n## Workarounds\n\nUpgrading is the only complete fix.\n\nFor **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:\n\n```js\n.where('meta', 'eq', JSON.stringify(value))   // safe on >= 2.0.2\n```\n\nThere is no workaround for **vector 1** other than upgrading to 2.0.2 or later.\n\nDo 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.","state":0,"publishedAt":"2026-07-28T22:19:23+00:00","modifiedAt":"2026-08-04T20:45:18.8725079+00:00","affected":[{"ecosystem":"npm","name":"@hypequery/clickhouse","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2.5.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/hypequery/hypequery/security/advisories/GHSA-6wcc-39rp-hh9p","https://nvd.nist.gov/vuln/detail/CVE-2026-54658","https://github.com/hypequery/hypequery/pull/349","https://github.com/hypequery/hypequery/commit/2879161a810fed2c2222f785816ff05510976960","https://github.com/hypequery/hypequery/commit/2dc1df7bae","https://github.com/hypequery/hypequery/commit/4dfa9d77d70a08b970e722268b75ca7d13db0bdf","https://github.com/hypequery/hypequery","https://github.com/hypequery/hypequery/blob/main/packages/clickhouse/CHANGELOG.md#202","https://github.com/hypequery/hypequery/releases/tag/@hypequery/clickhouse@2.0.2","https://github.com/hypequery/hypequery/releases/tag/@hypequery/clickhouse@2.5.1"],"sourceUrl":"https://github.com/advisories/GHSA-6wcc-39rp-hh9p","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-6wcc-39rp-hh9p","identifiers":["GHSA-6wcc-39rp-hh9p","CVE-2026-54658"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-23T10:27:17.0420685+00:00","complete":true,"records":1790,"lastAttemptAt":"2026-11-23T10:27:17.0420685+00:00","lastSuccessAt":"2026-11-23T10:27:17.3455273+00:00","error":null,"lastVerifiedAt":"2026-11-23T10:27:17.3455278+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-d008fb8e7e5a0f37166ee57a6d9d22b27e49b9d9438b4ce80c4c6c326ac5d75a-4da2658e28505d28fff6a82583fdd2805c842c2db68ba8203057a43f5c054d49","complete":true,"records":430604,"lastAttemptAt":"2026-11-23T10:25:33.576572+00:00","lastSuccessAt":"2026-11-23T10:25:33.5278746+00:00","error":null,"lastVerifiedAt":"2026-11-23T10:25:33.576572+00:00","snapshotPublishedAt":"2026-11-23T10:21:26+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-b78b096b281d45a3bd4932b3c356f72b","complete":false,"records":13928,"lastAttemptAt":"2026-11-23T10:36:53.2048331+00:00","lastSuccessAt":"2026-11-23T10:36:53.201+00:00","error":"198 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-23T10:36:53.201+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13772,"expectedIdentifiers":13976,"failedIdentifiers":198},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-23T10:27:17.0420685+00:00","complete":true,"records":1131,"lastAttemptAt":"2026-11-23T10:27:17.0420685+00:00","lastSuccessAt":"2026-11-23T10:27:17.3463529+00:00","error":null,"lastVerifiedAt":"2026-11-23T10:27:17.346353+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-6986a0970f4446f4869253ed98765e2d","complete":true,"records":13940,"lastAttemptAt":"2026-11-23T10:27:18.5797172+00:00","lastSuccessAt":"2026-11-23T10:27:18.577+00:00","error":null,"lastVerifiedAt":"2026-11-23T10:27:18.577+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13976,"expectedIdentifiers":13976,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-a9c862bcf8bde52ce182f69609f4579ca2fc6956e44f694dddf6a66800619683","complete":true,"records":9989,"lastAttemptAt":"2026-11-23T10:27:13.109079+00:00","lastSuccessAt":"2026-11-22T16:25:54.6432964+00:00","error":null,"lastVerifiedAt":"2026-11-23T10:27:13.109079+00:00","snapshotPublishedAt":"2026-11-22T16:18:32+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-6ba2352decd0c95d34a1b50f642582aa34659ce946f552488f0a5cea4e0cc09a","complete":true,"records":2020,"lastAttemptAt":"2026-11-23T10:25:33.6409661+00:00","lastSuccessAt":"2026-11-20T15:46:15.4249619+00:00","error":null,"lastVerifiedAt":"2026-11-23T10:25:33.6409661+00:00","snapshotPublishedAt":"2026-11-20T14:48:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-9035327876399d833ccd89428db993d67e1ee675265fd15c191a68c5fa77f5a4","complete":true,"records":3216,"lastAttemptAt":"2026-11-23T10:27:16.996724+00:00","lastSuccessAt":"2026-11-23T10:27:16.8439398+00:00","error":null,"lastVerifiedAt":"2026-11-23T10:27:16.996724+00:00","snapshotPublishedAt":"2026-11-23T09:49:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-9fee8da2e967466c6e884db81aa523bbe4d6fc47473cfe7cd96a2b59dbbea25d","complete":true,"records":232876,"lastAttemptAt":"2026-11-23T10:27:12.985201+00:00","lastSuccessAt":"2026-11-23T10:27:11.9530843+00:00","error":null,"lastVerifiedAt":"2026-11-23T10:27:12.985201+00:00","snapshotPublishedAt":"2026-11-23T10:18:42+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}