CVE-2026-142190: Knex through 3.3.0 SQL Injection via unescaped enu() schema builder values
Knex through 3.3.0 contains an sql injection vulnerability that allows attackers to inject SQL into DDL statements by supplying enum values containing single quotes to the enu() column method. Attackers can terminate the literal to neutralize SQLite CHECK constraints or execute stacked statements like DROP TABLE on PostgreSQL with the database connection's privileges.
Affected Software
Event History
Frequently Asked Questions
What attacker-controlled data must reach the application to exploit this issue?
An attacker must be able to supply enum values that are passed to Knex's enu() schema-builder column method. Values containing single quotes can terminate the generated SQL literal.
How does impact differ by database backend?
On SQLite, injected SQL can neutralize CHECK constraints. On PostgreSQL, the issue can permit stacked statements, including statements such as DROP TABLE.
What permissions could injected SQL have?
Injected SQL executes with the privileges of the database connection used by the application. The resulting impact therefore depends on the permissions granted to that connection.
Which Knex versions should be reviewed?
Knex versions through 3.3.0 are identified as affected. Review schema-generation paths that pass externally influenced values to enu().