NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-34220: MikroORM is vulnerable to SQL Injection via specially crafted object

criticalCVSS 4.0 9.3GHSA-gwhv-j974-6fxm

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.

Published Mar 29, 2026 · Updated Mar 31, 2026

Affected packages

@mikro-orm/core

Ecosystem
npm
Affected
< 6.6.10
Fixed in
6.6.10
Check
npm ls @mikro-orm/core

@mikro-orm/core

Ecosystem
npm
Affected
>= 7.0.0-dev.0, < 7.0.6
Fixed in
7.0.6
Check
npm ls @mikro-orm/core

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to lukas-eu.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology