
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-33468 is a SQL injection vulnerability in the Kysely TypeScript SQL query builder library, specifically affecting the CreateIndexBuilder.where() and CreateViewBuilder.as() methods when using the MySQL dialect. The root cause is that DefaultQueryCompiler.sanitizeStringLiteral() escapes single quotes but fails to escape backslash characters, allowing attackers to break out of string literals in MySQL environments where NO_BACKSLASH_ESCAPES is OFF (the default). All Kysely npm versions up to and including 0.28.13 are affected; version 0.28.14 contains the fix. It carries a CVSS v3.1 base score of 8.1 (High) (Github Advisory, Kysely Advisory).
The vulnerability is classified as CWE-89 (Improper Neutralization of Special Elements used in an SQL Command). The flaw resides in DefaultQueryCompiler.sanitizeStringLiteral() (default-query-compiler.ts:1819-1821), which only replaces single quotes with doubled quotes (' → '') via the regex /'/g, but does not escape backslash characters. When appendStringLiteral() wraps the sanitized value in single quotes, a user-supplied input like \' OR 1=1 -- causes MySQL to interpret \' as an escaped literal quote, allowing the second ' to close the string and the remainder to be parsed as SQL. The MysqlQueryCompiler class extends DefaultQueryCompiler without overriding sanitizeStringLiteral, inheriting the vulnerable behavior. This code path is triggered via ImmediateValueTransformer, which is used by both CreateIndexBuilder.where() and CreateViewBuilder.as() to inline values directly into DDL statements (Github Advisory, Kysely Advisory).
Successful exploitation allows an attacker who controls values passed to the affected DDL builder methods to execute arbitrary SQL against the MySQL database. This enables data exfiltration via UNION-based or subquery-based techniques, data modification or destruction through stacked queries or subqueries, and potential authentication bypass if index creation or view definitions are influenced by user-controlled input in application logic. The impact is rated High across confidentiality, integrity, and availability (Github Advisory).
A proof-of-concept exploit with concrete reproduction steps — including a specific malicious TypeScript payload, compiled SQL output, and live MySQL setup instructions — is publicly available in the official security advisory (Kysely Advisory). The EPSS score is approximately 0.034% (0.000480), indicating a low current probability of exploitation in the wild. There is no evidence of active in-the-wild exploitation or threat actor attribution at this time, and the vulnerability is not listed in the CISA KEV catalog. Attack complexity is rated High because exploitation requires an application to pass untrusted user input into DDL schema builder methods, which is an atypical usage pattern (Github Advisory).
CreateIndexBuilder.where() or CreateViewBuilder.as().\' OR 1=1 -- as the value to be passed to the vulnerable method.sanitizeStringLiteral() doubles the single quote but leaves the backslash unescaped, producing SQL like: WHERE \status` = ''' OR 1=1 --'. MySQL interprets 'as an escaped literal quote, causingOR 1=1` to be evaluated as SQL.\' UNION SELECT table_name,2,3 FROM information_schema.tables -- ) to exfiltrate data, or use subqueries to modify or delete records.= '\'' or OR 1=1 -- in DDL statements (CREATE INDEX, CREATE VIEW); unexpected UNION SELECT or subquery constructs in index/view creation queries.\') in parameters that are used for schema operations.Upgrade Kysely to version 0.28.14 or later, which fixes the issue by overriding sanitizeStringLiteral in MysqlQueryCompiler to escape backslashes before doubling single quotes (\ → \\, then ' → ''). As an immediate workaround, do not pass untrusted user input directly to CreateIndexBuilder.where() or CreateViewBuilder.as(). Additionally, enabling NO_BACKSLASH_ESCAPES mode in MySQL removes the backslash escape behavior and mitigates the injection vector, though upgrading the library remains the recommended fix. Review all application code for instances where user-controlled data reaches DDL schema builder methods and refactor to use safe alternatives or strict input validation (Github Advisory, Kysely Advisory).
The vulnerability was reported by researcher igalklebanov and published by the Kysely maintainers on March 20, 2026. Social media activity was observed on Bluesky and Mastodon shortly after disclosure, with automated CVE tracking accounts sharing the advisory. No significant independent researcher commentary or major media coverage has been identified beyond standard vulnerability aggregator coverage (Kysely Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."