Skip to main content

Knex EUVDEUVD-2026-141515

| CVE-2026-142190 HIGH
SQL Injection (CWE-89)
2026-12-02 VulnCheck GHSA-9hx6-vfgp-fg3m
7.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Supply crafted enum value to enu() method
  2. Exploit
    Single quote terminates DDL string literal
  3. Execution
    Inject stacked SQL into CREATE/ALTER statement
  4. Impact
    Execute DROP TABLE with DB connection privileges

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 an application that passes attacker-influenced values into Knex's enu() schema-builder column method so they reach DDL generation; the attacker-supplied enum value must contain a single quote to break out of the string literal. Impact is dialect-dependent: on SQLite it bypasses the generated CHECK constraint, while on PostgreSQL it enables stacked statements such as DROP TABLE, executed with the database connection's privileges. The principal limiting factor is that schema and enum definitions are normally hardcoded by developers, so the flaw is only reachable where untrusted input is routed into schema-building code - a non-default, uncommon pattern reflected in the CVSS AC:H/AT:P/PR:L metrics.

Impact

The input CVSS 4.0 score of 7.7 (High) is tempered by its own metrics: AC:H, AT:P and PR:L all indicate exploitation is not trivial or fully unauthenticated, consistent with the real limiting factor - enum values supplied to Knex's enu() column method are normally developer-controlled schema definitions, not user input, so the flaw only becomes reachable in the unusual pattern where untrusted data flows into DDL/schema-building code. No EPSS score was provided in the input, and the CVE is not listed in CISA KEV, so there is no signal of active exploitation; the vuln.today decision label is 'this_week' (not act_now/emergency), aligning with a serious-but-conditional issue rather than a mass-exploited one. This is a genuine SQL injection (CWE-89) with high integrity/availability impact where reachable, but it is better characterized as a high-CVSS flaw gated by an uncommon application pattern than a broadly exploitable priority. Because no EPSS or KEV data is available to confirm or contradict this, prioritization rests on whether a given deployment actually passes attacker-controlled values into schema-builder enum definitions.

Exploit ScenarioDerived

An application uses Knex to build or alter table schemas where the enum value list is derived from untrusted input; an attacker submits an enum value containing a single quote (e.g. x') to terminate the string literal inside the generated DDL. On SQLite this neutralizes the intended CHECK constraint, while on PostgreSQL the attacker appends a stacked statement such as DROP TABLE, executed with the database connection's privileges. No confirmed working exploit code is identified in the provided sources.

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 lets attackers who can influence values passed to the enu() schema-builder column method break out of a string literal in generated DDL, neutralizing SQLite CHECK constraints or running stacked statements such as DROP TABLE on PostgreSQL with the database connection's privileges. Reachability is limited: schema and enum definitions are normally developer-controlled, so exploitation requires the uncommon pattern of routing untrusted input into DDL/schema-building code, consistent with the assessed AC:H, AT:P and PR:L metrics. No public exploit was identified at time of analysis, and the decision label places remediation in the this_week queue.

RemediationAI

No vendor-released patch identified at time of analysis; no fixed version is listed in the supplied references, so track https://github.com/knex/knex/issues/4481 and the VulnCheck advisory for a fix. Until then, remove or gate code paths that pass request data into Knex schema-builder methods, especially enu(); validate enum values against a strict allowlist that rejects single quotes and all non-identifier characters (side effect: legitimate values containing punctuation will be rejected). Where dynamic DDL is unavoidable, generate the DDL outside Knex with explicit, dialect-correct literal/identifier quoting and re-review it before execution. Run migrations and schema-building code with a least-privilege database account that cannot execute stacked DDL such as DROP TABLE (side effect: legitimate migrations needing DDL may fail).

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 whose schema builder compiles column definitions into dialect-specific DDL. The enu() column method accepts enum values and emits them into the DDL string; the referenced MySQL, PostgreSQL and SQLite3 column-compiler source lines show where these values are handled, and the flaw is CWE-89 improper neutralization of special elements used in SQL. A single quote in a supplied enum value terminates the literal, so on SQLite the generated CHECK constraint can be neutralized, while on PostgreSQL stacked statements such as DROP TABLE can be executed with the database connection's privileges. The trigger is not described beyond the need for attacker-influenced values to reach enu(); the assessed vector indicates network access, high attack complexity, attack requirements present, low privileges required, and no user interaction.

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.1 HIGH

Injection is network-reachable but requires the uncommon path of untrusted input into schema-builder enum values (AC:H, PR:L); DDL tampering and DROP TABLE give I:H/A:H, with limited read capability (C:L).

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/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 that allows attackers to inject SQL into DDL statements by supplying enum values containing single quotes to the enu() column method. Attackers can terminate the literal to neutralize SQLite CHECK constraints or execute stacked statements like DROP TABLE on PostgreSQL with the database connection's privileges.

Executive ViewAI

Why It Matters

A high-severity SQL injection vulnerability has been identified in Knex, a widely used SQL query builder library, affecting schema-building operations through version 3.3.0. The flaw could allow an attacker to manipulate database schema definitions, potentially neutralizing security constraints or executing destructive database commands like DROP TABLE, though exploitation requires the uncommon scenario where untrusted input is funneled into schema-building code. Leadership should care because this affects a core dependency used across many applications and could lead to data loss or integrity breaches if exploited, with remediation prioritized for this week.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

Prevalence
Medium
popular Node.js SQL query builder, common in web backends
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