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.
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.
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.
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.
{
"github_reviewed": true,
"nvd_published_at": "2026-03-31T16:16:32Z",
"cwe_ids": [
"CWE-89"
],
"github_reviewed_at": "2026-03-29T15:44:04Z",
"severity": "CRITICAL"
}