@mikro-orm/mssql is vulnerable to SQL Injection
64
Medium Risk
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.
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.
@mikro-orm/mssql is vulnerable to SQL Injection in versions 6.2.0 - 6.6.15 and 7.0.0 - 7.1.6.
Upgrade the @mikro-orm/mssql library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant