Vulnerability library
Security checkMarch 27, 2026

Kysely has a MySQL SQL Injection via Backslash Escape Bypass in non-type-safe usage of JSON path keys.

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

High severitynpmkysely

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

The sanitizeStringLiteral method in Kysely’s query compiler escapes single quotes (' → '') but does not escape backslashes. On MySQL with the default BACKSLASH_ESCAPES SQL mode, an attacker can inject a backslash before a single quote to neutralize the escaping, breaking out of the JSON path string literal and injecting arbitrary SQL.

Recommendation

Update the kysely package to the latest compatible version. Followings are version details:

  • Affected version(s): >= 0.28.12, <= 0.28.13
  • Patched version(s): 0.28.14

References

Could your website be exposed too?

SmartScanner can check your website for Kysely has a MySQL SQL Injection via Backslash Escape Bypass in non-type-safe usage of JSON path keys. and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated March 27, 2026