Skip to main content

CVE-2026-34220

CRITICAL
SQL Injection (CWE-89)
2026-03-29 https://github.com/mikro-orm/mikro-orm GHSA-gwhv-j974-6fxm
9.3
CVSS 4.0 · Vendor: https://github.com/mikro-orm/mikro-orm
View

Attack ChainAIDerived

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

  1. Access
    Send crafted object to MikroORM API
  2. Exploit
    Object interpreted as raw SQL fragment
  3. Execution
    SQL injection executed
  4. Impact
    Unauthorized database access achieved

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

MikroORM versions ≤6.6.9 and ≤7.0.5. Requires attacker control over input passed to ORM write APIs: wrap(entity).assign(userInput), em.nativeUpdate(), em.nativeInsert(), or em.create(). No authentication or user interaction needed. Remote exploitation possible if application accepts untrusted data via network.

Impact

Real-world risk is moderate and highly context-dependent. While this is a classic SQL injection vulnerability with potentially critical impact (data exfiltration, modification, or deletion), exploitation requires specific application architecture: the vulnerable code path only triggers when applications pass unsanitized user-controlled objects directly to MikroORM write APIs without intermediate validation. Modern web frameworks often employ input validation, TypeScript type guards, or DTO validation libraries (like class-validator) that would prevent malicious object structures from reaching the ORM layer. The vulnerability is NOT actively exploited (no KEV listing), and no public proof-of-concept exploit code exists at time of analysis. Applications using strict schema validation or input sanitization before ORM operations are explicitly stated as not affected. The fix is available through symbol-based markers that cannot be replicated via JSON deserialization or user input, indicating this was an architectural oversight rather than a complex logic flaw. Priority should be high for applications accepting raw JSON input and passing it directly to affected MikroORM APIs, but lower for applications with robust input validation layers.

Exploit ScenarioDerived

An attacker submits a malicious JSON payload to a Node.js API endpoint that accepts user profile updates. The application deserializes this JSON and passes the resulting object directly to MikroORM's wrap(entity).assign(userInput) method without validation. The attacker's crafted object contains properties mimicking MikroORM's internal SQL fragment markers, causing the ORM to interpret attacker-controlled strings as raw SQL. When em.flush() executes, the injected SQL commands run against the database with the application's privileges, potentially allowing the attacker to extract sensitive data through UNION-based injection, modify records, or execute stored procedures depending on database permissions and the specific query context.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.0% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Mar 29, 2026

SQL injection in MikroORM JavaScript ORM (versions ≤6.6.9 and ≤7.0.5) allows attackers to execute arbitrary SQL commands when specially crafted user-controlled objects are passed to query construction APIs. The vulnerability stems from duck-typed detection of internal ORM markers that attackers can replicate in malicious input objects. Applications passing unsanitized user input directly to write APIs like wrap().assign(), em.nativeUpdate(), em.nativeInsert(), or em.create() are exploitable. No public exploit identified at time of analysis, though the attack technique is straightforward for environments accepting untrusted JSON/object input.

RemediationAI

Upgrade to MikroORM version 6.6.10 or later for the 6.x release line, or version 7.0.6 or later for the 7.x release line, which implement symbol-based internal markers that cannot be reproduced through user input. The patched versions are available via npm package manager. As an immediate workaround for applications unable to upgrade immediately, implement strict input validation and type checking before passing any user-controlled data to MikroORM write APIs including wrap().assign(), em.nativeUpdate(), em.nativeInsert(), and em.create(). Use TypeScript interfaces with runtime validation libraries like class-validator or zod to enforce expected object structures and reject objects containing unexpected properties. Avoid passing raw request bodies or unsanitized JSON directly to ORM methods. Review all code paths where user input flows to the affected APIs and ensure schema validation occurs before ORM interaction. Detailed advisory and patch information: https://github.com/mikro-orm/mikro-orm/security/advisories/GHSA-gwhv-j974-6fxm.

Affected Packages

npm @mikro-orm/core fix: 6.6.10, 7.0.6

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

MikroORM is a TypeScript ORM for Node.js supporting multiple SQL databases (PostgreSQL, MySQL, SQLite, MongoDB). The vulnerability (CWE-89: SQL Injection) occurs in the query construction layer where the ORM previously used duck-typing to identify internal query fragments through object property patterns. Attackers could craft JavaScript objects mimicking these internal marker properties, causing the ORM to misinterpret user data as raw SQL fragments. The affected package is @mikro-orm/core (pkg:npm/@mikro-orm_core). This architectural flaw affects write operations that merge untrusted object properties into database queries, particularly the entity assignment and native query APIs that dynamically construct SQL from JavaScript object structures.

Know when the next one hits your stack

  • 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 (https://github.com/mikro-orm/mikro-orm) PRIMARY 9.3 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/mikro-orm/mikro-orm) · only source for this CVE.

CVSS VectorVendor: https://github.com/mikro-orm/mikro-orm

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

Lifecycle Timeline

2
Patch released
Mar 31, 2026 - 21:13 nvd
Patch available
CVE Published
Mar 29, 2026 - 15:44 nvd
CRITICAL 9.3

DescriptionCVE.org

Summary

MikroORM versions <= 6.6.9 and <= 7.0.5 are vulnerable to SQL injection when specially crafted objects are interpreted as raw SQL query fragments.

Impact

If user-controlled input is passed directly to MikroORM query construction APIs, an attacker may inject raw SQL fragments. This can lead to SQL injection depending on the database and query being executed.

Affected usage

The issue occurs when untrusted objects are passed to ORM write APIs such as:

  • wrap(entity).assign(userInput) followed by em.flush()
  • em.nativeUpdate()
  • em.nativeInsert()
  • em.create() followed by em.flush()

Applications that validate input types or enforce strict schema validation before passing data to MikroORM are not affected.

Fix

The vulnerability was caused by duck-typed detection of internal ORM marker properties.

The fix replaces these checks with symbol-based markers that cannot be reproduced by user input.

Executive ViewAI

Why It Matters

MikroORM JavaScript ORM versions 6.6.9 and earlier, and 7.0.5 and earlier, contain a critical SQL injection vulnerability that allows attackers to execute arbitrary database commands when applications pass unsanitized user input directly to query construction APIs. Organizations using affected MikroORM versions with user-controllable data risk complete database compromise, including unauthorized data access, modification, or destruction. Immediate inventory and mitigation of applications using this ORM is required.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Implement strict input validation and schema whitelisting before passing any user-supplied data to MikroORM write APIs; (2) Use parameterized/prepared queries and avoid direct object binding for user input; (3) Apply principle of least privilege to database service accounts; (4) Enable comprehensive database audit logging to detect exploitation attempts; (5) Consider temporary restrictions on write API exposure in user-facing features until patch is available.

Threat Intelligence Overview

EPSS Score
0.0%
Top 91% exploitable
Threat Intel
2
1 sources
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment NEWS GHSA GitHub VulDB

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 CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
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.

Affected Products (CPE)CVE.org

pkg:npm/@mikro-orm_core
pkg:npm/@mikro-orm_core

Related Vulnerabilities in MikroORM SQL Injection and Prototype Pollution

View all 2

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