CVE-2026-34220
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend crafted object to MikroORM API
-
ExploitObject interpreted as raw SQL fragment
-
ExecutionSQL injection executed
-
ImpactUnauthorized 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
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
Lifecycle Timeline
2DescriptionCVE.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 byem.flush()em.nativeUpdate()em.nativeInsert()em.create()followed byem.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
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.
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
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.
GHSA-gwhv-j974-6fxm
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB