Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. kysely
  4. ›
  5. CVE-2026-44635

CVE-2026-44635: Kysely: JSON-path traversal injection via unsanitized path-leg metacharacters in `JSONPathBuilder.key()` / `.at()`

May 11, 2026 (updated June 8, 2026)

Kysely 0.28.12 added a sanitizeStringLiteral() call inside DefaultQueryCompiler.visitJSONPathLeg (commit 0a602bf, PR #1727) to fix CVE-2026-32763 (GHSA-wmrf-hv6w-mr66). The fix only doubles single quotes (' → ''); it does not escape JSON-path metacharacters (., [, ], *, **, ?). When attacker-controlled input flows into eb.ref(col, '->$').key(input) or .at(input) — including type-safe code where the JSON column is shaped like Record<string, T> so K extends string is the inferred type — every dot becomes a path-leg separator, letting an attacker traverse from the intended key into sibling and child fields the developer never meant to expose. The result is read access (and, in update statements, write access) to JSON sub-fields outside the intended scope across MySQL, PostgreSQL ->$/->>$, and SQLite.

  • Project: Kysely — TypeScript SQL query builder (npm kysely); affects MySQL, PostgreSQL ->$/->>$, and SQLite dialects.
  • Source reviewed: kysely-org/kysely @ master (73192e4, version 0.28.16).
  • Deployed artefact validated: kysely@0.28.16 from npm.
  • Affected file(s):
  • src/query-compiler/default-query-compiler.ts (lines 1611–1639, 1821–1823)
  • src/query-builder/json-path-builder.ts (lines 93–196)
  • src/dialect/mysql/mysql-query-compiler.ts (overrides sanitizeStringLiteral but inherits the same behaviour for path legs — escapes \ and ', nothing else)
  • CWE: CWE-89 — Improper Neutralization of Special Elements used in an SQL Command, with CWE-915 / CWE-1284 (improper validation of specified quantity in input) flavours for the JSON-path sub-language.
  • OWASP 2021: A03:2021 — Injection.

References

  • github.com/advisories/GHSA-pv5w-4p9q-p3v2
  • github.com/kysely-org/kysely/releases/tag/v0.28.17
  • github.com/kysely-org/kysely/security/advisories/GHSA-pv5w-4p9q-p3v2
  • nvd.nist.gov/vuln/detail/CVE-2026-44635

Code Behaviors & Features

Detect and mitigate CVE-2026-44635 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.26.0 before 0.28.17

Fixed versions

  • 0.28.17

Solution

Upgrade to version 0.28.17 or above.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-1284: Improper Validation of Specified Quantity in Input
  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
  • CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes

Source file

npm/kysely/CVE-2026-44635.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:24:45 +0000.