CVE-2026-34220: @mikro orm/core SQL Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-gwhv-j974-6fxm
CWE-89
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-34220
GHSA Identifier GHSA-gwhv-j974-6fxm
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product @mikro orm/core
Package Ecosystem npm
Published Date
Last Updated

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.

@mikro-orm/core fixed: 6.6.10
npm install @mikro-orm/core@6.6.10
@mikro-orm/core fixed: 7.0.6
npm install @mikro-orm/core@7.0.6
Verify Direct and Transitive Dependencies

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

## 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.

CVE-2026-34220 Affected @mikro orm/core Versions

2 component(s)
Fixed Versions:
6.6.107.0.6
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?
CVE-2026-34220 is a security vulnerability in @mikro orm/core involving MikroORM is vulnerable to SQL Injection via specially crafted object under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which @mikro orm/core versions are affected?
Affected versions include releases prior to 6.6.10, 7.0.6 across affected packages: @mikro-orm/core.
What version fixes CVE-2026-34220?
Upgrading to 6.6.10, 7.0.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @mikro-orm/core affected?
Yes, @mikro-orm/core is affected in releases prior to 6.6.10, 7.0.6. Upgrade your dependency to 6.6.10, 7.0.6 or later.
What CWE is associated with CVE-2026-34220?
CVE-2026-34220 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (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.).
How can I check npm dependencies for CVE-2026-34220?
Run the dependency tree command: 'npm ls @mikro-orm/core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}