CVE-2026-39356 — drizzle-orm
HIGHCVE-2026-39356 is a high-severity (CVSS 7.5) SQL Injection vulnerability in drizzle-orm. A fix is available for drizzle-orm — see the affected versions and patch details below.
SQL Injection via escapeName() in all Drizzle ORM SQL dialects
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-39356.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
drizzle-ormnpmDescription
Summary
Drizzle ORM improperly escaped quoted SQL identifiers in its dialect-specific escapeName() implementations. In affected versions, embedded identifier delimiters were not escaped before the identifier was wrapped in quotes or backticks.
As a result, applications that pass attacker-controlled input to APIs that construct SQL identifiers or aliases, such as sql.identifier(), .as(), may allow an attacker to terminate the quoted identifier and inject SQL.
Affected components
The issue affects the identifier escaping logic used by the PostgreSQL, MySQL, SQLite, SingleStore, and Gel dialects.
Impact
This issue only affects applications that pass untrusted runtime input into identifier or alias construction. Common examples include dynamic sorting, dynamic report builders, and CTE or alias names derived from request parameters.
Depending on the database dialect, query context, and database permissions, successful exploitation may enable blind or direct data disclosure, schema enumeration, query manipulation, privilege escalation, or destructive operations.
Applications that use only static schema objects, or that strictly map user input through an allowlist of known column or alias names, are not affected.
Details
In affected versions, escapeName() wrapped the identifier but did not escape the quote delimiter inside the identifier value:
- PostgreSQL / SQLite / Gel:
"was not doubled to"" - MySQL / SingleStore:
`was not doubled to``
Because of this, crafted input containing the dialect-specific identifier delimiter could break out of the quoted identifier and be interpreted as SQL syntax.
A representative vulnerable pattern is dynamic sorting using untrusted input:
const sortField = req.query.sort || 'id';
const rows = await db
.select()
.from(users)
.orderBy(sql.identifier(sortField));
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | drizzle-orm | all versions | 0.45.2npm install drizzle-orm@0.45.2 |
| 📦npm | drizzle-orm | ≥ 1.0.0-beta.2&&< 1.0.0-beta.20 | 1.0.0-beta.20npm install drizzle-orm@1.0.0-beta.20 |
Affected Products
drizzledrizzleDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for drizzle-orm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update drizzle-orm to 0.45.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-39356 is resolved across your whole dependency graph.
Workarounds
Until you can upgrade, make sure every query built from user input uses parameterised statements or a prepared-statement API rather than string concatenation, and reduce the database account's privileges so an injected query cannot read or alter data beyond what the feature needs.
Frequently Asked Questions
Is CVE-2026-39356 in your dependencies?
Find it across npm, including transitive dependencies.