High, CVSS 7.5npmAmendedPublished
Drizzle ORM has SQL injection via improperly escaped SQL identifiers
CVE-2026-39356 · GHSA-gpj5-g38j-94v9
- Affected
- npm drizzle-orm < 0.45.2; >= 1.0.0-beta.2, < 1.0.0-beta.20
- Fixed in
- 1.0.0-beta.200.45.2· Vendor fix available
- Issue
- 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…
Recommended action: Upgrade to 1.0.0-beta.20 (pre-release) or 0.45.2 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.