Packages / @mikro-orm/core / Security

CriticalVulnerabilityGHSA-gwhv-j974-6fxmCVE-2026-34220Published 29 Mar 2026

MikroORM is vulnerable to SQL Injection via specially crafted object

Your version

Affected releases · @mikro-orm/core

  • 7.x7.0.0 – 7.0.5Fixed in 7.0.6
  • 6.x6.0.0 – 6.6.9Fixed in 6.6.10
  • 5.x and older4.0.0 – 5.9.8No fix, no longer updated

On 7.x, the newest line:

npm install @mikro-orm/core@7.0.6
Every release on a timeline
7.x
  1. Affected

    7.0.0 – 7.0.5

    6 releases

  2. Fixed

    7.0.6 – 7.2.11

    40 releases, latest

6.x
  1. Affected

    6.0.0 – 6.6.9

    82 releases

  2. Fixed

    6.6.10 – 6.6.19

    10 releases

5.x
  1. Affected

    5.0.0 – 5.9.8

    78 releases

4.x
  1. Affected

    4.0.0 – 4.5.10

    34 releases

250 stable releases of @mikro-orm/core, oldest to newest, one row per major.

What happens

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.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.