Type-safe TypeScript SQL Query Builder Vulnerability in Kysely
CVE-2026-33468
8.1HIGH
What is CVE-2026-33468?
Kysely, a type-safe TypeScript SQL query builder, has a vulnerability in its DefaultQueryCompiler.sanitizeStringLiteral() method prior to version 0.28.14. This method only addresses the escaping of single quotes by doubling them but fails to escape backslashes. In environments using the MySQL dialect with NO_BACKSLASH_ESCAPES set to OFF, an attacker may exploit this oversight. By using a backslash in a string literal, they can bypass the intended string context, leading to arbitrary SQL injection. This issue prominently affects code paths utilizing ImmediateValueTransformer for inlining values, especially noted in CreateIndexBuilder.where() and CreateViewBuilder.as(). Version 0.28.14 rectifies this vulnerability.
Affected Version(s)
kysely < 0.28.14
