Repository navigation
fix(gel-core): escape embedded double quotes in escapeName (CVE-2026-39356) - #6026
Open
rakibulism wants to merge 1 commit into
Open
rakibulism wants to merge 1 commit into
rakibulism wants to merge 1 commit into
Conversation
…39356) GHSA-gpj5-g38j-94v9 was fixed for pg-core, mysql-core, sqlite-core and singlestore-core in drizzle-team#5534 (0.45.2), but gel-core/dialect.ts was missed. GelDialect.escapeName() still wrapped identifiers in quotes without doubling embedded `"` characters, allowing SQL injection via sql.identifier()/.as() when fed untrusted input. This applies the same fix used for the other dialects and adds a regression test using the payload from the original advisory.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GHSA-gpj5-g38j-94v9 / CVE-2026-39356 was fixed for
pg-core,mysql-core,sqlite-core, andsinglestore-corein #5534 (released as0.45.2), butgel-core/dialect.tswas not updated in that PR.GelDialect.escapeName()still does:which does not double embedded
"characters, so untrusted input passed tosql.identifier()/.as()can break out of the quoted identifier and inject arbitrary SQL — the same issue the original advisory describes, just still present in one dialect.name.replace(/"/g, '""')).drizzle-orm/tests/gel-escape-name.test.ts, a regression test using the same injection payload from the original advisory's PG test. Confirmed it fails against the unpatched code and passes with the fix.drizzle-ormunit test suite (568 tests) — all passing.Test plan
npx vitest run tests/gel-escape-name.test.tspasses with the fixescapeNameimplementation (verifies the test actually catches the bug)npx vitest run tests/— 568/568 passing, no regressions