Update dependency kysely to v0.28.12 [SECURITY]#463
Merged
renovate[bot] merged 1 commit intomainfrom Mar 20, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.28.11→0.28.12GitHub Vulnerability Alerts
CVE-2026-32763
Summary
Kysely through 0.28.11 has a SQL injection vulnerability in JSON path compilation for MySQL and SQLite dialects. The
visitJSONPathLeg()function appends user-controlled values from.key()and.at()directly into single-quoted JSON path string literals ('$.key') without escaping single quotes. An attacker can break out of the JSON path string context and inject arbitrary SQL.This is inconsistent with
sanitizeIdentifier(), which properly doubles delimiter characters for identifiers — both are non-parameterizable SQL constructs requiring manual escaping, but only identifiers are protected.Details
visitJSONPath()wraps JSON path in single quotes ('$...'), andvisitJSONPathLeg()appends each key/index value viathis.append(String(node.value))with no sanitization:Contrast with
sanitizeIdentifier()in the same file, which properly doubles delimiter characters:Both identifiers and JSON path keys are non-parameterizable SQL constructs that require manual escaping. Identifiers are protected; JSON path values are not.
PostgreSQL is not affected. The branching happens in
JSONPathBuilder.#createBuilderWithPathLeg()(json-path-builder.js):->$,->>$) produce aJSONPathNodetraversal →visitJSONPathLeg()concatenates the key directly into a single-quoted JSON path string ('$.key') — vulnerable, no escaping.->,->>) produce aJSONOperatorChainNodetraversal →ValueNode.createImmediate(value)→appendImmediateValue()→appendStringLiteral()→sanitizeStringLiteral()doubles single quotes ('→''), generating chained operators ("col"->>'city'). Injection payload becomes a harmless string literal.Same
.key()call, different internal node creation depending on the operator type. The PostgreSQL path reuses the existing string literal sanitization; the MySQL/SQLite JSON path construction bypasses it entirely.PoC
End-to-end proof against a real SQLite database (Kysely 0.28.11 + better-sqlite3):
The payload includes
as "city" from "users"to complete the first SELECT before the UNION. The--comments out the trailing' as "city" from "users"appended by Kysely.Generated SQL:
Realistic application pattern
Dynamic JSON field selection is a common pattern in search APIs, GraphQL resolvers, and admin panels that expose JSON column data.
Suggested fix
Escape single quotes in JSON path values within
visitJSONPathLeg(), similar to howsanitizeIdentifier()doubles delimiter characters. Alternatively, validate that JSON path keys contain only safe characters. The direction of the fix is left to the maintainers.Impact
SQL Injection (CWE-89) — An attacker can inject arbitrary SQL via crafted JSON key names passed to
.key()or.at(), enabling UNION-based data exfiltration from any database table. MySQL and SQLite dialects are affected. PostgreSQL is not affected.Release Notes
kysely-org/kysely (kysely)
v0.28.12: 0.28.12Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
eb.ref(col, '->$').key(key)is injectable. by @igalklebanov in #1727MySQL 🐬
mysql2@​v3.18.2support #1722 by @fenichelar in #1729📖 Documentation
📦 CICD & Tooling
🐤 New Contributors
Full Changelog: kysely-org/kysely@v0.28.11...v0.28.12
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.