Skip to main content

Knex EUVDEUVD-2026-141514

| CVE-2026-142191 HIGH
SQL Injection (CWE-89)
2026-12-02 VulnCheck GHSA-xp5q-36vg-8c47
7.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain authenticated app access
  2. Exploit
    Supply table name with single quote
  3. Execution
    Break out of object_id() literal
  4. Impact
    Append 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

knex 0 ≤3.3.0

Affected Packages

euvd knex no fix

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

Vendor (VulnCheck) PRIMARY 7.7 HIGH
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
vuln.today AI 7.5 HIGH

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.

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

Prevalence
High
Knex is a very widely used Node.js SQL query builder
Data Quality
3 sources
Confidence: Low

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS N/A
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy