CVE-2026-32763: Kysely SQL Injection Vulnerability via Unsanitized JSON Path Keys

kysely Updated 18 Mar 2026

Summary

18/03/2026
Yes i
High
8.2

CVE-2026-32763: Kysely through 0.28.11 has a SQL injection vulnerability in JSON path compilation for MySQL and SQLite dialects. Affects kysely versions >= 0.26.0, < 0.28.12. Fixed in 0.28.12. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Kysely is an open-source SQL query builder for TypeScript that provides a fluent API for constructing SQL queries. It supports various database dialects, including MySQL, SQLite, and PostgreSQL. The package is designed to facilitate the building of complex queries while maintaining type safety. However, a vulnerability has been identified in versions up to 0.28.11, where unsanitized JSON path keys can lead to SQL injection attacks.

Vulnerability Detail

The vulnerability arises from the visitJSONPathLeg() function in Kysely, which appends user-controlled values from .key() and .at() directly into single-quoted JSON path string literals without proper escaping. This oversight allows an attacker to break out of the JSON path string context and inject arbitrary SQL commands. The affected dialects are MySQL and SQLite, while PostgreSQL is not impacted. The potential ramifications include unauthorized data access and manipulation through crafted JSON key names, enabling attackers to perform UNION-based data exfiltration from any database table.

How To Fix

Latest published version: 0.29.7 as of 23 Oct 2026

npm install kysely@0.29.7

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.28.12

This is the first release that contains the fix.

npm install kysely@0.28.12

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can escape single quotes in JSON path values within the visitJSONPathLeg() function. For example, modify the code to include a sanitization step that doubles single quotes before appending them to the JSON path string. Here is a conceptual example:

visitJSONPathLeg(node) {
    const isArrayLocation = node.type === 'ArrayLocation';
    this.append(isArrayLocation ? '[' : '.');
    this.append(String(node.value).replace(/'/g, "''")); // Escape single quotes
    if (isArrayLocation) {
        this.append(']');
    }
}

Conclusion

The Kysely SQL injection vulnerability (CVE-2026-32763) poses a significant risk to applications using affected versions of the package. It is crucial to update to the patched version or implement workarounds to safeguard against potential SQL injection attacks. Regular monitoring with tools like Vulert can help maintain awareness of vulnerabilities in your software.

See every vulnerability recorded for kysely →

Share this vulnerability

FAQ

The vulnerability is an SQL injection that occurs due to unsanitized JSON path keys in Kysely, allowing attackers to inject arbitrary SQL.

Kysely versions up to 0.28.11 are affected by this vulnerability. Version 0.28.12 and later contain the fix.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without any signup.

An attacker could exploit this vulnerability to gain unauthorized access to sensitive data by injecting SQL commands that can exfiltrate data from any database table.

If an immediate update is not possible, implement the suggested workaround to escape single quotes in JSON path values to mitigate the risk temporarily.

Related vulnerabilities

Recent vulnerabilities recorded for kysely.

How To Fix

Latest published version: 0.29.7 as of 23 Oct 2026

npm install kysely@0.29.7

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.28.12

This is the first release that contains the fix.

npm install kysely@0.28.12

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback