GitHub Advisoryadvisory · npm
GHSA-gwhv-j974-6fxm MikroORM is vulnerable to SQL Injection via specially crafted object
CRITICAL
Official page ↗
- Aliases
- CVE-2026-34220
- Ecosystem
- npm
- Packages
- @mikro-orm/core
- Severity
- Critical
- CVSS vector
- 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
- Weaknesses
- CWE-89
- Reviewed
- 2026-03-29
Affected packages
• npm @mikro-orm/core: < 6.6.10 → fixed in 6.6.10
• npm @mikro-orm/core: >= 7.0.0-dev.0, < 7.0.6 → fixed in 7.0.6
Description
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.
Related
Alias · CVE (1)
- CVE-2026-34220 MikroORM is a TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. vulnerability
Weakness · CWE (1)
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command weakness