Knex through 3.3.0 SQL Injection via MSSQL dropTableIfExists, dropViewIfExists and createTableIfNotExists
CVE-2026-142191Published 2 Dec 2026, 16:50 UTC
Real-world risk
1.0/ 10Low
Routine
If the vulnerable configuration applies to you: 2.3
PreliminaryFrom the CVSS vector only · confidence low
CVSS
7.7
scored by the vendor (CNA), CVSS 4.0
In plain words
No plain-language summary yet. The original description is below.
Original description (from VulnCheck)
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.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| knexNiche | <= 3.3.0 | — |
What to do
Check the vendor advisory in the references below for fixed versions and workarounds.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | Full compromiseCode execution or full control of the system or application | From the CVSS vector | 1.00 |
| Attacker position | InternetAnyone on the Internet can reach a typical deployment | From the CVSS vector | 1.00 |
| Privileges needed | LowA real low-privileged account | From the CVSS vector | 0.60 |
| Victim interaction | NoneNothing | From the CVSS vector | 1.00 |
| Configuration | UncommonNeeds a non-default feature that a minority enables | From the CVSS vector | 0.45 |
| Reliability | HardNarrow race, needs an extra info leak, needs a man-in-the-middle position, or must be chained with another bug | From the CVSS vector | 0.45 |
Threat level T1: Nothing known (× 0.85)
The default for a new disclosure
The arithmetic
- Prerequisites multiplied together0.122
- Threat T1: Nothing known0.850
- 10 × impact 1 × prerequisites 0.1215 × threat 0.851.033
- Rounded to one decimal between 0.1 and 101.0
Exploitation and evidence timeline
- 2 Dec 2026 Published
- 2 Dec 2026 Risk 1.0 (cvss fallback)
Weakness
CWE-89
References
- https://github.com/knex/knex/blob/3.3.0/lib/dialects/mssql/schema/mssql-compiler.js#L10-L22technical-description
- https://github.com/knex/knex/blob/3.3.0/lib/dialects/mssql/index.js#L132-L138technical-description
- https://www.vulncheck.com/advisories/knex-through-3.3.0-sql-injection-via-mssql-droptableifexists-dropviewifexists-and-createtableifnotexiststhird-party-advisory
- CVE-2026-142191 on CVE.org