CVE-2026-142191: Knex through 3.3.0 SQL Injection via MSSQL dropTableIfExists, dropViewIfExists and createTableIfNotExists

Published Dec 2, 2026
·
Updated

Knex through 3.3.0 contains an sql injection vulnerability in the MSSQL dialect that allows attackers to inject T-SQL via table or view names. Attackers can supply names containing a single quote to close the objectid() literal in dropTableIfExists, dropViewIfExists, or createTableIfNotExists and execute arbitrary T-SQL with the database connection's privileges.

Affected Software

1 affected component
npm/knex<=3.3.0

Event History

Dec 2, 2026
CVE Published
via MITRE·04:50 PM
Data Sourced
via MITRE·04:50 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are affected?

Applications using Knex through version 3.3.0 with the MSSQL dialect are affected when they call dropTableIfExists, dropViewIfExists, or createTableIfNotExists using table or view names that an attacker can influence.

2

What must an attacker control to exploit this issue?

The attacker must be able to supply a table or view name containing a single quote to one of the affected schema operations. This closes the object_id() literal and can allow arbitrary T-SQL to run with the privileges of the application's database connection.

3

How can teams identify potentially vulnerable code paths?

Review MSSQL Knex schema operations for calls to dropTableIfExists, dropViewIfExists, and createTableIfNotExists. Prioritize calls where object names originate from request data or any other attacker-controlled input.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203