CVE-2026-33468: Kysely MySQL SQL Injection via Insufficient Backslash Escaping

kysely Updated 20 Mar 2026

Summary

20/03/2026
Yes i
High
8.1

CVE-2026-33468: Kysely's DefaultQueryCompiler.sanitizeStringLiteral() only escapes single quotes by doubling them (' → '') but does not escape backslashes. Affects kysely versions < 0.28.14. Fixed in 0.28.14. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Kysely is a powerful SQL query builder for TypeScript that allows developers to construct complex SQL queries in a type-safe manner. It supports various database dialects, including MySQL, and is designed to facilitate database interactions while ensuring type safety and ease of use. However, a critical vulnerability has been identified in its handling of string literals in MySQL, which can lead to SQL injection attacks if user input is not properly sanitized.

Vulnerability Detail

The vulnerability arises from Kysely's DefaultQueryCompiler.sanitizeStringLiteral() method, which only escapes single quotes by doubling them but fails to escape backslashes. In MySQL, where NO_BACKSLASH_ESCAPES is OFF by default, an attacker can exploit this oversight by injecting backslashes into string literals. This allows them to escape the trailing quote of a string literal, effectively breaking out of the string context and injecting arbitrary SQL commands. The affected methods include CreateIndexBuilder.where() and CreateViewBuilder.as(), which can lead to severe consequences such as data exfiltration, data modification, and authentication bypass.

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.14

This is the first release that contains the fix.

npm install kysely@0.28.14

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

Workaround

As a temporary workaround, avoid passing untrusted user input directly into CreateIndexBuilder.where() or CreateViewBuilder.as() methods. Instead, consider using parameterized queries where possible to prevent SQL injection.

Conclusion

The Kysely package has a critical vulnerability (CVE-2026-33468) that can lead to SQL injection attacks due to improper handling of string literals in MySQL. It is essential to update to version 0.28.14 or later to mitigate this risk. Additionally, using Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for kysely →

Share this vulnerability

FAQ

CVE-2026-33468 is a vulnerability in the Kysely package that allows for SQL injection attacks due to insufficient escaping of backslashes in MySQL string literals.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in your software. Visit Vulert Scanner to use the Vulert playground without signup.

The vulnerability can lead to SQL injection, allowing attackers to read arbitrary data, modify or delete data, and potentially bypass authentication controls.

You can update the Kysely package by running the command 'npm install kysely@0.28.14' in your project directory to ensure you have the patched version.

The CVSS score of this vulnerability is 8.1, indicating a high severity level.

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.14

This is the first release that contains the fix.

npm install kysely@0.28.14

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