GHSA-gpj5-g38j-94v9 — drizzle-orm
HIGHGHSA-gpj5-g38j-94v9 is a high-severity (CVSS 7.5) vulnerability in drizzle-orm. A fix is available for drizzle-orm — see the affected versions and patch details below.
Drizzle ORM has SQL injection via improperly escaped SQL identifiers
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 GHSA-gpj5-g38j-94v9.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-gpj5-g38j-94v9 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 378,567 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
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 |
Detection & 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 GHSA-gpj5-g38j-94v9 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-gpj5-g38j-94v9 can be triaged on real exposure rather than presence alone.
Tailored to GHSA-gpj5-g38j-94v9. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-gpj5-g38j-94v9 in your dependencies?
O3 Security finds GHSA-gpj5-g38j-94v9 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.