@mikro-orm/mssql is vulnerable to SQL Injection
64
CVE Score
Medium
SQL Injection
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.
Upgrade the @mikro-orm/mssql library to the patch version.
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.
6.2.0 - 6.6.15
Fixed in 6.6.167.0.0 - 7.1.6
Fixed in 7.1.7@mikro-orm/mssql is vulnerable to SQL Injection in versions 6.2.0 - 6.6.15 and 7.0.0 - 7.1.6.
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.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.