Skip to content
Heist/ feed
Back to feed
High

Kysely has a MySQL SQL Injection via Insufficient Backslash Escaping in `sql.lit(string)` usage or similar methods that append string literal values into the compiled SQL strings

Type: advisorySources: OSV

Kysely is a type-safe TypeScript SQL query builder. Prior to version 0.28.14, Kysely's `DefaultQueryCompiler.sanitizeStringLiteral()` only escapes single quotes by doubling them (`'` → `''`) but does not escape backslashes. When used with the MySQL dialect (where `NO_BACKSLASH_ESCAPES` is OFF by default), an attacker can use a backslash to escape the trailing quote of a string literal, breaking out of the string context and injecting arbitrary SQL. This affects any code path that uses `ImmediateValueTransformer` to inline values — specifically `CreateIndexBuilder.where()` and `CreateViewBuilder.as()`. Version 0.28.14 contains a fix.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-33468
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 07:48 UTC · Revision 1

Source evidence

Kysely has a MySQL SQL Injection via Insufficient Backslash Escaping in `sql.lit(string)` usage or similar methods that append string literal values into the compiled SQL strings

core-osv · Original source

Published 26 Mar 2026, 17:03 UTC

Kysely is a type-safe TypeScript SQL query builder. Prior to version 0.28.14, Kysely's `DefaultQueryCompiler.sanitizeStringLiteral()` only escapes single quotes by doubling them (`'` → `''`) but does not escape backslashes. When used with the MySQL dialect (where `NO_BACKSLASH_ESCAPES` is OFF by default), an attacker can use a backslash to escape the trailing quote of a string literal, breaking out of the string context and injecting arbitrary SQL. This affects any code path that uses `ImmediateValueTransformer` to inline values — specifically `CreateIndexBuilder.where()` and `CreateViewBuilder.as()`. Version 0.28.14 contains a fix.

osv:CVE-2026-33468
Complete source record
{
  "id": "dd26d34d713471327a3504fd9e6dbfb1c1d93b987b187777c29a12791794a3f7",
  "url": "https://osv.dev/vulnerability/CVE-2026-33468",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Kysely has a MySQL SQL Injection via Insufficient Backslash Escaping in `sql.lit(string)` usage or similar methods that append string literal values into the compiled SQL strings",
    "summary": "Kysely is a type-safe TypeScript SQL query builder. Prior to version 0.28.14, Kysely's `DefaultQueryCompiler.sanitizeStringLiteral()` only escapes single quotes by doubling them (`'` → `''`) but does not escape backslashes. When used with the MySQL dialect (where `NO_BACKSLASH_ESCAPES` is OFF by default), an attacker can use a backslash to escape the trailing quote of a string literal, breaking out of the string context and injecting arbitrary SQL. This affects any code path that uses `ImmediateValueTransformer` to inline values — specifically `CreateIndexBuilder.where()` and `CreateViewBuilder.as()`. Version 0.28.14 contains a fix.",
    "evidence": "osv:CVE-2026-33468",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-33468",
      "aliases": [
        "CVE-2026-33468",
        "GHSA-8cpq-38p9-67gx"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/kysely-org/kysely",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "91cf3733b2a419f5b17dff118cedb7052ab5300d"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.28.14"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "cpe": "cpe:2.3:a:kysely:kysely:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.28.14"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.28.13",
            "v0.28.12",
            "v0.28.11",
            "v0.28.10",
            "v0.28.9",
            "v0.28.8",
            "v0.28.7",
            "v0.28.6",
            "v0.28.5",
            "v0.28.4",
            "v0.28.3",
            "0.28.2",
            "0.28.1",
            "0.28.0",
            "0.27.6",
            "0.27.5",
            "0.27.4",
            "0.27.3",
            "0.27.2",
            "0.27.1",
            "0.27.0",
            "0.26.3",
            "0.26.2",
            "0.26.1",
            "0.26.0",
            "0.25.0",
            "0.24.2",
            "0.24.0",
            "0.23.5",
            "0.23.4",
            "0.23.3",
            "0.23.2",
            "0.23.1",
            "0.23.0",
            "0.22.0",
            "0.21.6",
            "0.21.5",
            "0.21.4",
            "0.21.3",
            "0.21.2",
            "0.21.1",
            "0.21.0",
            "0.20.1",
            "0.20.0",
            "0.19.12",
            "0.19.11",
            "0.19.10",
            "0.19.9",
            "0.19.8",
            "0.19.7",
            "0.19.6",
            "0.19.5",
            "0.19.4",
            "0.19.3",
            "0.19.2",
            "0.19.1",
            "0.19.0",
            "0.18.1",
            "0.18.0",
            "0.17.3",
            "0.17.2",
            "0.17.0",
            "0.16.11",
            "0.16.10",
            "0.16.9",
            "0.16.8",
            "0.16.7",
            "0.16.6",
            "0.16.5",
            "0.16.4",
            "0.16.3",
            "0.16.2",
            "0.16.1",
            "0.16.0",
            "0.15.3",
            "0.15.2",
            "0.15.1",
            "0.15.0",
            "0.14.1",
            "0.14.0",
            "0.13.0",
            "0.12.2",
            "0.12.1",
            "0.12.0",
            "0.11.4",
            "0.11.3",
            "0.11.2",
            "0.11.1",
            "0.11.0",
            "0.10.1",
            "0.10.0",
            "0.9.9",
            "0.9.8",
            "0.9.7",
            "0.9.6",
            "0.9.5",
            "0.9.4",
            "0.9.3",
            "0.9.2",
            "0.9.1",
            "0.9.0",
            "0.7.9",
            "0.7.8"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-33468.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:33.797147542Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33468.json",
        "https://github.com/kysely-org/kysely/security/advisories/GHSA-8cpq-38p9-67gx",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-33468"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-89"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33468.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-33468",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 500965,
  "published_at": "2026-03-26T17:03:05.972+00:00"
}