fix(gel-core): patch escapeName per GHSA-gpj5-g38j-94v9 (incomplete fix in 0.45.2)#5865
Draft
sravan27 wants to merge 1 commit into
Draft
fix(gel-core): patch escapeName per GHSA-gpj5-g38j-94v9 (incomplete fix in 0.45.2)#5865sravan27 wants to merge 1 commit into
sravan27 wants to merge 1 commit into
Conversation
…ix in 0.45.2) The 0.45.2 security release advertised the SQL identifier escaping fix for the PostgreSQL, MySQL, SQLite, SingleStore, AND Gel dialects, but the patch commit (273c780) only touched the first four. The Gel dialect escapeName still does return `"${name}"`; which leaves the same identifier-delimiter injection that the parent CVE documented. This brings Gel in line with the other dialects: return `"${name.replace(/"/g, '""')}"`;
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
The 0.45.2 security release (GHSA-gpj5-g38j-94v9) advertised SQL-identifier-escape fixes for the PostgreSQL, MySQL, SQLite, SingleStore, and Gel dialects. The actual patch commit (
273c780) only touched the first four. The Gel dialectescapeNameis stillwhich is the pre-CVE shape that allows the same identifier-delimiter SQL injection the parent advisory documents. This PR brings the Gel dialect in line with the other four — one line, the same
replace(/"/g, )pattern.Repro
Confirmed against
drizzle-orm@0.45.2published tarball (package/gel-core/dialect.cjsstill ships the unpatched version):Same shape as the advisory: any application that pipes an attacker-controlled value through
sql.identifier()or.as()(dynamic sort fields, dynamic alias names, CTE naming from request params) can break out of the quoted identifier on the Gel dialect even after upgrading to 0.45.2.Disclosure note
Reported privately to
security@drizzle.teamfirst; happy to coordinate timing on the public merge / release. Filing as a draft-style PR with the one-line fix to make it easy to land alongside whatever Gel-specific test you would prefer. If a security-track release is the preferred path I can close this PR and move it to the Security Advisories flow.Patch
Suggested regression test
If the existing escape test for
pg-corecovers the basic shape, the same fixture against theGelDialectwould catch a future regression. Happy to add it in a follow-up commit.