Skip to content

chore(deps): update dependency drizzle-orm to v0.45.2 [security] - #56

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-drizzle-orm-vulnerability
Open

chore(deps): update dependency drizzle-orm to v0.45.2 [security]#56
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-drizzle-orm-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Apr 9, 2026

Copy link
Copy Markdown

This PR contains the following updates:

Package Change Age Confidence
drizzle-orm (source) 0.45.10.45.2 age confidence

Drizzle ORM has SQL injection via improperly escaped SQL identifiers

CVE-2026-39356 / GHSA-gpj5-g38j-94v9

More information

Details

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));

#### Severity
- CVSS Score: 7.5 / 10 (High)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`

#### References
- [https://github.com/drizzle-team/drizzle-orm/security/advisories/GHSA-gpj5-g38j-94v9](https://redirect.github.com/drizzle-team/drizzle-orm/security/advisories/GHSA-gpj5-g38j-94v9)
- [https://nvd.nist.gov/vuln/detail/CVE-2026-39356](https://nvd.nist.gov/vuln/detail/CVE-2026-39356)
- [https://github.com/advisories/GHSA-gpj5-g38j-94v9](https://redirect.github.com/advisories/GHSA-gpj5-g38j-94v9)

This data is provided by the [GitHub Advisory Database](https://redirect.github.com/advisories/GHSA-gpj5-g38j-94v9) ([CC-BY 4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Release Notes

<details>
<summary>drizzle-team/drizzle-orm (drizzle-orm)</summary>

### [`v0.45.2`](https://redirect.github.com/drizzle-team/drizzle-orm/releases/tag/0.45.2)

[Compare Source](https://redirect.github.com/drizzle-team/drizzle-orm/compare/0.45.1...0.45.2)

- Fixed `sql.identifier()`, `sql.as()` escaping issues. Previously all the values passed to this functions were not properly escaped
  causing a possible SQL Injection (CWE-89) vulnerability

Thanks to [@&#8203;EthanKim88](https://redirect.github.com/EthanKim88), [@&#8203;0x90sh](https://redirect.github.com/0x90sh) and [@&#8203;wgoodall01](https://redirect.github.com/wgoodall01) for reaching out to us with a reproduction and suggested fix

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

 **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/tindotdev/append).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMTAuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjMuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

@socket-security

socket-security Bot commented Apr 9, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addeddrizzle-orm@​0.45.2881008898100

View full report

@renovate
renovate Bot force-pushed the renovate/npm-drizzle-orm-vulnerability branch from e228033 to 43e3ed3 Compare July 19, 2026 00:01
@socket-security

socket-security Bot commented Jul 19, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm drizzle-orm is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: packages/api/package.jsonnpm/drizzle-orm@0.45.2

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/drizzle-orm@0.45.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@renovate
renovate Bot force-pushed the renovate/npm-drizzle-orm-vulnerability branch from 43e3ed3 to b1f6231 Compare July 20, 2026 19:00
@renovate
renovate Bot force-pushed the renovate/npm-drizzle-orm-vulnerability branch from b1f6231 to 34afa39 Compare July 30, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants