Intel

AIKIDO-2026-929875

@mikro-orm/mssql is vulnerable to SQL Injection

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jul 22, 2026
July 22, 2026

64

CVE Score

Medium

SQL Injection

Are you affected? Scan for Free

TL;DR

The MSSQL platform builds ORDER BY clauses by lowercasing the requested sort direction and embedding it directly into the generated SQL. The order-by field key is validated against entity metadata, but the direction value is not checked against the known QueryOrder values, so an application that forwards a user-controlled direction into orderBy lets crafted tokens reach the query. On MSSQL this can break out of the intended clause and inject arbitrary SQL, including additional statements. The fix adds a validateOrderByDirection() allow-list that rejects any direction outside the canonical ascending and descending variants.

How do I fix this?

Upgrade the @mikro-orm/mssql library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application passes a user-controlled or otherwise untrusted order-by direction value into a query.

Versions

6.2.0 - 6.6.15

Fixed in 6.6.16

7.0.0 - 7.1.6

Fixed in 7.1.7

Background info

@mikro-orm/mssql is vulnerable to SQL Injection in versions 6.2.0 - 6.6.15 and 7.0.0 - 7.1.6.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea