drizzle-team / drizzle-team/drizzle-orm

sql-js session interpolates config.behavior into raw SQL without validation

Open
#5,512 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

drizzle-orm/src/sql-js/session.ts:55 does sql.raw(\`begin \${config.behavior}\`). The behavior field is meant to be 'deferred', 'immediate', or 'exclusive', but there's no validation before it hits raw SQL.

If an app passes user input into SQLiteTransactionConfig.behavior, that goes straight into the query. Adding a whitelist check would close this off.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.