CVE-2026-142191: Knex SQL Injection
Published 2026-12-02 · Updated 2026-12-04 · Source disclosure@vulncheck.com
Not known to be exploited · high severity — apply the vendor fix or mitigation in your next patch cycle.
What to do
- The advisory lists versions through 3.3.0 as affected and does not name a fixed release. Check the references below for a newer version of Knex or a vendor mitigation.
- Until it is patched, restrict network access to Knex and review which accounts can log in to it.
- Put WAF rules in front of the affected parameters, and make sure the application's database account holds only the privileges it needs.
Affected and fixed versions
| Product | Affected | Fixed in |
|---|---|---|
| Knex | ≤ 3.3.0 | Not stated in the advisory |
Derived by HackerFeeds from the advisory text, CVSS vector and weakness class. Confirm versions against the vendor advisory before acting.
How it can be exploited
It can be exploited remotely over the network; the attacker needs an ordinary low-privileged account, and no action by a victim is required. Attack complexity is high, so exploitation depends on conditions the attacker does not control. The impact on confidentiality, integrity and availability is rated high.
| Attack vector | Network | It can be exploited remotely over the network. |
|---|---|---|
| Attack complexity | High | Success depends on conditions outside the attacker's control. |
| Privileges required | Low | The attacker needs an ordinary low-privileged account. |
| User interaction | None | No action by a victim is needed. |
| Confidentiality | High | Total loss of confidentiality. |
| Integrity | High | Total loss of integrity. |
| Availability | High | Total loss of availability. |
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness: SQL Injection
Attacker-controlled input changes the structure of a database query, which can expose, modify or delete data and sometimes leads to code execution on the database host.
Classified as CWE-89.
Description
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 object_id() literal in dropTableIfExists, dropViewIfExists, or createTableIfNotExists and execute arbitrary T-SQL with the database connection's privileges.
Advisory text as published in the NVD record.
References
- Advisoryhttps://www.vulncheck.com/advisories/knex-through-3.3.0-sql-injection-via-mssql-droptableifexists-dropviewifexists-and-createtableifnotexists
- Referencehttps://github.com/knex/knex/blob/3.3.0/lib/dialects/mssql/index.js#L132-L138
- Referencehttps://github.com/knex/knex/blob/3.3.0/lib/dialects/mssql/schema/mssql-compiler.js#L10-L22