
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-39356 is a SQL injection vulnerability in Drizzle ORM, a modern TypeScript ORM for Node.js, caused by improper escaping of quoted SQL identifiers in dialect-specific escapeName() implementations. It affects all stable releases prior to 0.45.2 and all 1.0.0 beta releases from beta.2 through beta.19. The vulnerability was published on April 7, 2026, with patches released as versions 0.45.2 and 1.0.0-beta.20. It carries a CVSS v3.1 base score of 7.5 (High) (GitHub Advisory, Drizzle Advisory).
The root cause (CWE-89) lies in the escapeName() function across multiple database dialect implementations — PostgreSQL, SQLite, Gel, MySQL, and SingleStore — which wraps identifiers in quotes or backticks but fails to escape embedded delimiter characters within the identifier value. Specifically, double-quote characters (") are not doubled to "" in PostgreSQL/SQLite/Gel dialects, and backtick characters (`) are not doubled to `` in MySQL/SingleStore dialects. This allows an attacker who controls input passed to APIs such as sql.identifier() or .as() to break out of the quoted identifier context and inject arbitrary SQL syntax. A representative vulnerable pattern involves dynamic sorting: const sortField = req.query.sort || 'id'; db.select().from(users).orderBy(sql.identifier(sortField)); (Drizzle Advisory).
Successful exploitation enables an unauthenticated, network-accessible attacker to inject arbitrary SQL commands into queries constructed by the affected application. Depending on the database dialect, query context, and database account permissions, this can result in blind or direct data disclosure, schema enumeration, query manipulation, privilege escalation, or destructive operations such as data deletion. The primary impact is high confidentiality loss; integrity and availability impacts depend on the database permissions granted to the application's database user. Only applications that pass untrusted runtime input into identifier or alias construction are affected — those using static schema objects or strict allowlists are not vulnerable (GitHub Advisory).
As of the time of publication, there is no public proof-of-concept exploit and no confirmed evidence of in-the-wild exploitation (Feedly). The EPSS score is approximately 0.017% (4th percentile), indicating a low near-term exploitation probability. No threat actor attribution has been reported, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The vulnerability requires no authentication and no user interaction, but exploitation is conditional on the application passing attacker-controlled input to the affected identifier APIs.
sql.identifier() or .as() without allowlist validation — common in dynamic sorting or report-builder features.id" UNION SELECT password FROM users--); for MySQL/SingleStore, use a backtick (e.g., id` UNION SELECT password FROM users--).GET /api/users?sort=id%22%20UNION%20SELECT%20password%20FROM%20users--).UNION, SELECT, FROM, --, SLEEP, WAITFOR) in query parameters associated with sorting, filtering, or alias fields; requests with URL-encoded quote or backtick characters in identifier-related parameters." or `) mid-query; database error messages referencing syntax errors in dynamically constructed identifiers.Upgrade Drizzle ORM to version 0.45.2 (stable) or 1.0.0-beta.20 (beta track) or later, which fix the identifier escaping logic in all affected dialects (Drizzle Advisory). As an interim workaround where immediate patching is not possible, implement strict allowlist validation for any user-supplied values passed to sql.identifier() or .as() — reject any input not matching a predefined set of known column or alias names. Conduct a code review to identify all locations where attacker-controlled data flows into identifier or alias construction APIs.
The vulnerability was reported by security researchers EthanKim88 and 0x90sh and disclosed by Drizzle ORM maintainer AndriiSherman via GitHub Security Advisories (Drizzle Advisory). Coverage appeared on The Hacker Wire and was shared on Bluesky by security community accounts shortly after disclosure. Community reaction has been moderate, consistent with a library-level SQL injection affecting a popular TypeScript ORM with a large user base (34.8k GitHub stars).
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."