chore(deps): bump drizzle-orm to 0.45.2 (CVE-2026-39356)#129
Conversation
Calls chittyfoundation/.github reusable workflow to arm auto-merge --squash --delete-branch on every non-draft PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Patches GHSA-gpj5-g38j-94v9 (SQL injection via improperly escaped sql.identifier() / sql.as()). First patched version: 0.45.2. Also bumps drizzle-kit 0.31.9 -> 0.31.10 (kept on 0.31.x for orm 0.45 compatibility). No chittyfinance code changes required: - decimal/numeric API unchanged (0.41 added opt-in modes only) - DrizzleQueryError wrapping (0.44) does not affect our error middleware -- no driver error code inspection in server/lib or server/middleware - query builder, $inferSelect/$inferInsert signatures stable Verification: - npm run check: clean - npm test: 23 failed / 293 passed (identical to pre-bump baseline; pre-existing failures unrelated to this bump) - pnpm audit --prod: drizzle-orm no longer in high/critical advisories Follow-up: CVE-2026-39356 can be removed from the accept-list in .github/workflows/security-gates.yml in a separate PR -- the gated audit step will continue to pass because the CVE is no longer present in the dep graph. Refs #126 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai review Please evaluate:
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a GitHub Actions workflow for automated PR merging and bumps the Drizzle ORM library to a significantly newer version along with a minor Drizzle Kit update. The changes are maintenance-focused with no breaking modifications to application code. ChangesGitHub Actions Auto-Merge Workflow
Dependency Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review — PR #129: drizzle-orm CVE-2026-39356 bumpOverviewThis PR patches a high-severity SQL injection vulnerability (CVE-2026-39356 / GHSA-gpj5-g38j-94v9) in drizzle-orm's Issues1. Unrelated workflow file bundled into a security patch PRThe new 2.
|
| Package | Old | New |
|---|---|---|
pg |
8.16.3 | 8.21.0 |
@modelcontextprotocol/sdk |
1.27.1 | 1.29.0 |
jose (JWT) |
6.1.3 | 6.2.3 |
openid-client |
6.8.1 | 6.8.4 |
oauth4webapi |
3.8.3 | 3.8.6 |
express-session |
1.18.2 | 1.19.0 |
express-rate-limit |
8.3.0 | 8.5.2 |
dotenv |
17.2.3 | 17.4.2 |
react-hook-form |
7.71.1 | 7.77.0 |
esbuild |
0.27.2 | 0.27.7 / 0.28.0 |
The pg, jose, and openid-client bumps are security-adjacent. They're all in-range and likely fine, but the PR description should acknowledge them so reviewers know what they're approving. It's also worth confirming pnpm audit --prod is fully clean post-bump, not just free of the drizzle CVE.
What Looks Good
- Correct target version. 0.45.2 is the
first_patched_versionper the advisory — not over-pinned, not under-pinned. - drizzle-zod compatibility preserved.
drizzle-zod@0.7.1resolves cleanly against the new drizzle-orm peer in the lockfile. - Breaking-changes table is thorough — the 0.40–0.45 changelog survey against this codebase is exactly the due diligence reviewers need.
- Test baseline confirmed unchanged — stashing the bump and rerunning to verify the 23-fail/293-pass parity is good practice.
- Deferred accept-list cleanup — keeping scope narrow is correct; removing the GHSA entry in a follow-up PR is the right call.
Suggested Actions Before Merge
- Move
auto-arm-merge.ymlto its own PR (or explain in a commit message why it belongs here). - Pin the external workflow to a commit SHA, not
@main. - Update the PR description to acknowledge the full set of transitive bumps.
- Run
pnpm audit --prod --jsonand post the full clean output as a PR comment, not just the drizzle-specific result.
Overall this is a well-structured security patch with solid documentation. The CVE fix is correct; the bundled unrelated workflow and its unpinned SHA are the items worth addressing before merge.
🤖 Generated with Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4b4d84b31
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| '@modelcontextprotocol/sdk': | ||
| specifier: ^1.27.1 | ||
| version: 1.27.1(zod@3.25.76) | ||
| version: 1.29.0(zod@3.25.76) |
There was a problem hiding this comment.
Limit this lockfile update to the Drizzle packages
When this lockfile is deployed, the Drizzle CVE patch also upgrades unrelated top-level runtime dependencies that were not changed in package.json (for example @modelcontextprotocol/sdk is now locked to 1.29.0, and the same importer section also bumps React Query, express-session, jose, pg, etc.). That means production behavior can change for auth/session/MCP/API code under a Drizzle-only security change, making regressions much harder to attribute; please regenerate the lockfile with only drizzle-orm/drizzle-kit targeted so the security fix stays isolated.
Useful? React with 👍 / 👎.
| types: [opened, ready_for_review, reopened] | ||
| jobs: | ||
| arm: | ||
| uses: chittyfoundation/.github/.github/workflows/auto-arm-merge.yml@main |
There was a problem hiding this comment.
Pin the reusable auto-merge workflow
Because this new workflow runs for every opened/reopened PR, delegating the whole job to chittyfoundation/.github at the mutable main ref means any later change or compromise in that repository immediately changes this repo's auto-merge behavior without a reviewed change here. Pin the reusable workflow to an immutable SHA or a controlled release tag so PR merge automation cannot drift underneath this repository.
Useful? React with 👍 / 👎.
| types: [opened, ready_for_review, reopened] | ||
| jobs: | ||
| arm: | ||
| uses: chittyfoundation/.github/.github/workflows/auto-arm-merge.yml@main |
There was a problem hiding this comment.
Point the reusable workflow at an existing file
This caller references auto-arm-merge.yml, but the public chittyfoundation/.github workflow directory at main currently lists documentation_check.yml, metadata_check.yml, new_repo_setup.yml, portfolio-hardening.yml, pr-governance.yml, and reusable-ci-pipeline.yml—not this file. As soon as a PR is opened or reopened, GitHub Actions will fail to resolve the called workflow, adding a permanently failing required check if this workflow is protected; update the uses: path/ref to an existing reusable workflow before enabling it.
Useful? React with 👍 / 👎.
Summary
drizzle-orm0.39.1 → 0.45.2 to patch CVE-2026-39356 / GHSA-gpj5-g38j-94v9 — SQL injection via improperly escapedsql.identifier()/sql.as().drizzle-kit0.31.9 → 0.31.10 (latest 0.31.x, compatible with orm 0.45).first_patched_version: 0.45.2).Refs #126 (drive accept-list to zero).
Breaking changes encountered
None required code changes in chittyfinance. Survey of the 0.40 → 0.45 release notes against this codebase:
mode: 'number' | 'bigint'for decimal/numericmode, default string behavior preserved (heavydecimal()use indatabase/system.schema.tsunaffected)pgEnumaccepts TS enums; duplicate-export cleanupcross join+ lateral joins; removed.fullJoin()from MySQLDrizzleQueryErrorwraps driver errorsserver/lib/error-handling.tsand middleware do not inspect drivererror.code(verified by grep)Files changed:
package.json(2 lines),pnpm-lock.yaml(regenerated). No source code touched.Verification
npm run check: clean (tsc passes with 0.45.2 types).npm test: 23 failed / 293 passed — identical to pre-bump baseline (confirmed by stashing the bump and rerunning). Failures are pre-existing and unrelated to drizzle.pnpm audit --prod --json:drizzle-ormno longer appears in high/critical advisories. CVE-2026-39356 is gone from the dep graph.Accept-list follow-up
The
CVE-2026-39356/GHSA-gpj5-g38j-94v9entries can now be removed from the accept-list in.github/workflows/security-gates.ymlin a separate small PR. This PR intentionally does NOT touch the accept-list to keep concerns separate; the gated audit step continues to pass because the CVE is no longer present.Test plan
npm run checkcleannpm testbaseline unchanged (23 fail / 293 pass before and after)pnpm audit --prodshows nodrizzle-ormadvisories🤖 Generated with Claude Code
Summary by CodeRabbit