fix(db-postgres): bump drizzle-orm to 0.45.2 to resolve an SQL injection vulnerability and pg to 8.20.0#16168
Conversation
|
I went a bit down a rabbit hole with this one. The initial goal was just to use After that, I noticed Drizzle had released a patch related to SQL injection, so I upgraded that as well. While doing that, I ran into type issues around This ended up being a much larger set of changes than originally intended. Let me know or split this up yourself if needed. |
|
Yeah let's make a PR which just updates PG and Drizzle, I'd like to review switching the package for vercel separately. |
58bfd66 to
a13ef5d
Compare
|
@r1tsuu I split it out. The Neon one is here siimsams#1 I will switch base to payload as soon as this gets merged. |
|
Thank you for taking a look and approving. I'm wondering if these failing tests are flaky or did I break something? 🤔 |
drizzle-orm to 0.45.2 to resolve an SQL injection vulnerability and pg to 8.20.0
Head branch was pushed to by a user without write access
|
I solved the merge conflicts in EDIT: |
e5f4d6d to
8ef5efe
Compare
|
@r1tsuu can this be merged now that the release has happened? |
…zzle-and-pg-versions
|
Thank you! ❤️ |
What?
Upgrade
drizzle-ormfrom 0.44.7 to 0.45.2 andpgfrom 8.16.3 to 8.20.0 (with@types/pg8.10.2 → 8.20.0) across all database adapter packages.Why?
Security:
drizzle-orm@0.45.2patches an SQL injection vulnerability (CWE-89) insql.identifier()andsql.as()where values were not properly escaped.Maintenance: Bringing
pg/@types/pgcurrent picks up upstream fixes and keeps the adapters aligned with the types the rest of the monorepo already resolves.The
@vercel/postgres→@neondatabase/serverlessmigration has been split out into a separate PR for independent review. fork payloadHow?
drizzle-orm0.44.7 → 0.45.2 indb-postgres,db-sqlite,db-d1-sqlite,db-vercel-postgres,drizzlepg8.16.3 → 8.20.0 and@types/pg8.10.2 → 8.20.0 indb-postgres,db-vercel-postgres,drizzledb-postgres/src/types.ts: FixPgDependencytype totypeof import('pg').default—@types/pg@8.20.0added anindex.d.mtswith ESM types wherePGis a module-level declaration, making the oldtypeof import('pg')incompatible with the default importdb-vercel-postgres/src/connect.ts: Castclienttopg.Poolat the twodrizzle()call sites.drizzle-orm@0.45.2tightenedNodePgClienttopg.Pool | PoolClient | Client, andVercelPoolextends@neondatabase/serverless'sPool(notpg's), so the cast is required to satisfy the stricter type while preserving runtime behavior.