CVE-2026-32763: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in kysely-org kysely
Kysely is a type-safe TypeScript SQL query builder. Versions up to and including 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. Version 0.28.12 fixes the issue.
AI Analysis
Technical Summary
Kysely is a type-safe SQL query builder for TypeScript that supports various SQL dialects including MySQL and SQLite. Versions from 0.26.0 through 0.28.11 contain a critical SQL injection vulnerability (CVE-2026-32763) due to improper neutralization of special elements in JSON path compilation. Specifically, the function visitJSONPathLeg() appends user-controlled values from the .key() and .at() methods directly into single-quoted JSON path string literals without escaping single quotes. Unlike identifier escaping handled by sanitizeIdentifier(), these JSON path components are not sanitized, allowing attackers to break out of the JSON path string context and inject arbitrary SQL code. This vulnerability affects the confidentiality and integrity of the database by enabling unauthorized data access or manipulation. The vulnerability is remotely exploitable without authentication or user interaction, increasing its risk. The issue was fixed in version 0.28.12 by implementing proper escaping of JSON path inputs, preventing injection attacks. No known exploits are currently reported in the wild, but the high CVSS score (8.2) reflects the severity and ease of exploitation.
Potential Impact
The SQL injection vulnerability in Kysely can lead to unauthorized disclosure of sensitive data, data tampering, or partial compromise of database integrity. Since Kysely is a query builder used in TypeScript applications interfacing with MySQL and SQLite, any application using affected versions is at risk. Attackers can remotely execute arbitrary SQL commands without authentication, potentially extracting confidential information or corrupting data. This can result in data breaches, regulatory non-compliance, and loss of customer trust. The vulnerability does not affect availability directly but can cause significant operational and reputational damage. Organizations relying on Kysely for backend database interactions, especially those handling sensitive or regulated data, face elevated risk until patched.
Mitigation Recommendations
Immediate upgrade to Kysely version 0.28.12 or later is the primary mitigation to ensure proper escaping of JSON path inputs. Until upgrade is possible, organizations should audit all usages of .key() and .at() methods in JSON path queries to identify potentially unsafe patterns. Avoid passing user-controlled input directly into JSON path components without manual sanitization. Implement additional input validation and sanitization layers at the application level to reject or escape single quotes and other special characters in JSON path inputs. Employ runtime monitoring and anomaly detection to identify suspicious SQL query patterns indicative of injection attempts. Restrict database user privileges to minimize impact if exploitation occurs. Finally, conduct security testing and code reviews focusing on SQL injection vectors in query builder usage.
Affected Countries
United States, Germany, United Kingdom, Canada, Australia, Netherlands, France, Japan, South Korea, India
CVE-2026-32763: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in kysely-org kysely
Description
Kysely is a type-safe TypeScript SQL query builder. Versions up to and including 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. Version 0.28.12 fixes the issue.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Kysely is a type-safe SQL query builder for TypeScript that supports various SQL dialects including MySQL and SQLite. Versions from 0.26.0 through 0.28.11 contain a critical SQL injection vulnerability (CVE-2026-32763) due to improper neutralization of special elements in JSON path compilation. Specifically, the function visitJSONPathLeg() appends user-controlled values from the .key() and .at() methods directly into single-quoted JSON path string literals without escaping single quotes. Unlike identifier escaping handled by sanitizeIdentifier(), these JSON path components are not sanitized, allowing attackers to break out of the JSON path string context and inject arbitrary SQL code. This vulnerability affects the confidentiality and integrity of the database by enabling unauthorized data access or manipulation. The vulnerability is remotely exploitable without authentication or user interaction, increasing its risk. The issue was fixed in version 0.28.12 by implementing proper escaping of JSON path inputs, preventing injection attacks. No known exploits are currently reported in the wild, but the high CVSS score (8.2) reflects the severity and ease of exploitation.
Potential Impact
The SQL injection vulnerability in Kysely can lead to unauthorized disclosure of sensitive data, data tampering, or partial compromise of database integrity. Since Kysely is a query builder used in TypeScript applications interfacing with MySQL and SQLite, any application using affected versions is at risk. Attackers can remotely execute arbitrary SQL commands without authentication, potentially extracting confidential information or corrupting data. This can result in data breaches, regulatory non-compliance, and loss of customer trust. The vulnerability does not affect availability directly but can cause significant operational and reputational damage. Organizations relying on Kysely for backend database interactions, especially those handling sensitive or regulated data, face elevated risk until patched.
Mitigation Recommendations
Immediate upgrade to Kysely version 0.28.12 or later is the primary mitigation to ensure proper escaping of JSON path inputs. Until upgrade is possible, organizations should audit all usages of .key() and .at() methods in JSON path queries to identify potentially unsafe patterns. Avoid passing user-controlled input directly into JSON path components without manual sanitization. Implement additional input validation and sanitization layers at the application level to reject or escape single quotes and other special characters in JSON path inputs. Employ runtime monitoring and anomaly detection to identify suspicious SQL query patterns indicative of injection attempts. Restrict database user privileges to minimize impact if exploitation occurs. Finally, conduct security testing and code reviews focusing on SQL injection vectors in query builder usage.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-13T18:53:03.533Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 69bc85a4e32a4fbe5f07b2e3
Added to database: 3/19/2026, 11:24:20 PM
Last enriched: 3/27/2026, 7:29:42 PM
Last updated: 5/3/2026, 7:58:41 PM
Views: 115
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.