Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain authenticated app access
-
ExploitSupply table name with single quote
-
ExecutionBreak out of object_id() literal
-
ImpactAppend and run arbitrary T-SQL as DB user
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the application use Knex with the MSSQL dialect and pass an attacker-controllable table or view name into one of three specific schema-builder methods: dropTableIfExists, dropViewIfExists, or createTableIfNotExists. The injection works by including a single quote in that name to close the literal passed to the generated object_id() call, after which arbitrary T-SQL can be appended. Limiting factors: the attacker must be able to influence those identifier values (per CVSS PR:L, some authenticated/application-level access and the AT:P precondition apply), and deployments that do not use the MSSQL dialect or that never route untrusted input into these schema methods are not exposed. Impact is bounded by the privileges of the database connection Knex uses. |
| Impact | This is a genuine but conditional priority. The supplied CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:L/UI:N) scores 7.7 (High), and the vuln.today decision label is 'this_week' - meaningful urgency, but short of act_now/emergency. The signals are internally consistent and point to a real-but-gated issue rather than a drop-everything emergency: PR:L means some authenticated/application-level access is required (not unauthenticated), and AT:P reflects that a specific precondition must hold - the application must route untrusted input into table or view name arguments of the MSSQL-dialect schema methods. CWE-89 with VC:H/VI:H/VA:H is appropriate because successful injection yields arbitrary T-SQL at the database connection's privilege level. No EPSS score was provided, there is no CISA KEV listing (so no confirmed active exploitation), and no confirmed working exploit code was supplied - the references are a VulnCheck advisory plus GitHub source lines pinpointing the flaw, not a PoC. Net: a well-characterized injection flaw in a popular library, worth prioritized remediation this week, but its real-world exposure depends heavily on whether a given deployment uses the MSSQL dialect and passes attacker-influenced identifiers to these specific methods. |
| Exploit ScenarioDerived | An application built on Knex (MSSQL dialect) passes a user-influenced table or view name into dropTableIfExists, dropViewIfExists, or createTableIfNotExists. An attacker with the ability to supply that name includes a single quote to close the string literal inside the generated object_id() call and appends arbitrary T-SQL, which then executes with the database connection's privileges. No confirmed public exploit code is identified at time of analysis; VulnCheck has published an advisory identifying the vulnerable source lines. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Dec 02, 2026
SQL injection in Knex through 3.3.0 (MSSQL dialect) lets an attacker who can influence a table or view name passed to dropTableIfExists, dropViewIfExists, or createTableIfNotExists break out of the generated object_id() string literal and append arbitrary T-SQL, executed with the database connection's privileges. The CVSS vector requires authenticated access (PR:L) plus attack requirements present (AT:P) and high attack complexity (AC:H), and exposure is limited to applications using the MSSQL dialect and routing untrusted identifier values into those three schema-builder methods. No public exploit code or confirmed active exploitation was identified at time of analysis, and the priority is to remediate this week.
RemediationAI
No vendor-released patch was identified at time of analysis, so treat this as a configuration and input-handling problem until a fixed Knex release is published and track the VulnCheck advisory (https://www.vulncheck.com/advisories/knex-through-3.3.0-sql-injection-via-mssql-droptableifexists-dropviewifexists-and-createtableifnotexists) and the Knex project for remediation guidance. Primary action: never pass user- or tenant-supplied strings as identifiers to dropTableIfExists, dropViewIfExists, or createTableIfNotExists; resolve names through an allowlist of known tables/views first, or replace the helper with a parameterized catalog lookup (for example against sys.tables/sys.views) plus a separately constructed, validated statement. Where dynamic identifiers cannot be avoided, enforce a strict identifier pattern (letters, digits, underscore, bounded length) and reject any value containing a quote or other T-SQL metacharacter, accepting that this restricts legitimate non-standard object names. Additional compensating control: run the Knex connection under a least-privilege MSSQL login that lacks DDL rights and access to unrelated schemas/databases, which bounds the impact of successful injection but does not prevent the injection itself and may break migrations that legitimately need DDL. Restrict which application roles or API callers can trigger schema-management operations, since the assessed prerequisite is authenticated application-level access.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Knex is a Node.js SQL query builder that generates dialect-specific SQL; its MSSQL schema compiler constructs object_id() string literals when emitting dropTableIfExists, dropViewIfExists and createTableIfNotExists statements (see lib/dialects/mssql/schema/mssql-compiler.js and lib/dialects/mssql/index.js). The flaw is CWE-89: the table or view name is embedded into that literal without proper escaping or parameterization, so a name containing a single quote closes the literal and allows T-SQL to be appended. Because the generated statement runs as ordinary query text, injected clauses execute under the privileges of the configured MSSQL connection. The trigger path is specifically those three schema helpers in the MSSQL dialect; the supplied sources do not describe any other injection vector or any bypass of an additional guard. Per the assessed vector, attack complexity is high, attack requirements are present, and the attacker must be authenticated at the application level.
Know when Knex gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Network-reachable (AV:N) but requires the app to feed attacker-influenced identifiers into specific MSSQL schema methods and some access (AC:H, PR:L); arbitrary T-SQL at DB privilege gives C/I/A High.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Executive ViewAI
CVE-2026-142191 is a high-severity SQL injection vulnerability in the Knex database library (MSSQL dialect) that could allow a low-privileged authenticated user to execute arbitrary database commands, potentially compromising data confidentiality and integrity. While exploitation requires specific conditions-attack complexity is high and only applications that pass untrusted table or view names to three schema-builder methods are exposed-the risk is elevated because no patch is yet available and database-level compromise could impact critical business systems. Leadership should prioritize remediation this week to prevent potential data breaches or service disruption.
No vendor-released patch identified at time of analysis; implement strict allowlisting of table and view names passed to the vulnerable methods, avoid using these methods with untrusted input, and enforce least-privilege database accounts.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
knex.js versions before 0.19.5 are vulnerable to SQL Injection attack. Rated critical severity (CVSS 9.8), this vulnerab
SQL injection in Knex through 3.3.0 lets attackers who can influence values passed to the enu() schema-builder column me
SQL injection in the Oracle dialect of the Knex.js query builder, affecting versions through 3.3.0, lets an attacker who
EUVD-2026-141514
GHSA-xp5q-36vg-8c47
NVD
CVE.org
Exploit-DB