CVE-2026-34220: @mikro orm/core SQL Injection Vulnerability
CRITICALCVE-2026-34220 is a CRITICAL sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting @mikro orm/core libraries in the npm ecosystem. The issue involves mikroorm is vulnerable to sql injection via specially crafted object. Remediation is available by upgrading affected packages to version 6.6.10, 7.0.6.
CVE-2026-34220 at a Glance
How to Fix CVE-2026-34220
To remediate this vulnerability, upgrade all affected @mikro orm/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @mikro-orm/core@6.6.10
npm install @mikro-orm/core@7.0.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @mikro-orm/core
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-34220, inspect your project dependencies using npm:
npm ls @mikro-orm/core
Analyze the terminal output to locate any version of @mikro orm/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.6.10), your application is affected.
Note: The npm ls @mikro-orm/core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In @mikro orm/core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-34220 Affected @mikro orm/core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@mikro-orm/core
|
npm |
< 6.6.10
|
6.6.10
|
|
@mikro-orm/core
|
npm |
≥ 7.0.0-dev.0
< 7.0.6
|
7.0.6
|
References
Frequently Asked Questions
What is CVE-2026-34220?
Which @mikro orm/core versions are affected?
What version fixes CVE-2026-34220?
Is @mikro-orm/core affected?
What CWE is associated with CVE-2026-34220?
How can I check npm dependencies for CVE-2026-34220?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gwhv-j974-6fxm",
"modified" : "2026-03-31T18:55:02Z",
"published" : "2026-03-29T15:44:04Z",
"aliases" : [ "CVE-2026-34220" ],
"summary" : "MikroORM is vulnerable to SQL Injection via specially crafted object",
"details" : "## Summary\n\nMikroORM versions <= 6.6.9 and <= 7.0.5 are vulnerable to SQL injection when specially crafted objects are interpreted as raw SQL query fragments.\n\n## Impact\n\nIf 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.\n\n## Affected usage\n\nThe issue occurs when untrusted objects are passed to ORM write APIs such as:\n\n- `wrap(entity).assign(userInput)` followed by `em.flush()`\n- `em.nativeUpdate()`\n- `em.nativeInsert()`\n- `em.create()` followed by `em.flush()`\n\nApplications that validate input types or enforce strict schema validation before passing data to MikroORM are not affected.\n\n## Fix\n\nThe vulnerability was caused by duck-typed detection of internal ORM marker properties.\n\nThe fix replaces these checks with symbol-based markers that cannot be reproduced by user input.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@mikro-orm/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.6.10"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@mikro-orm/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0-dev.0"
}, {
"fixed" : "7.0.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mikro-orm/mikro-orm/security/advisories/GHSA-gwhv-j974-6fxm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34220"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mikro-orm/mikro-orm"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-29T15:44:04Z",
"nvd_published_at" : "2026-03-31T16:16:32Z"
}
}