
Cloud Vulnerability DB
A community-led vulnerabilities database
The having option of em.find(), em.findOne(), em.findAndCount(), em.findByCursor(), em.count() and em.countBy() is typed as a filter object (em.countBy() exists only in v7). When a string is passed at runtime, it is embedded into the HAVING clause as raw SQL instead of being rejected.
Applications are affected when a request-controlled value reaches the having option without checking that it is an object, e.g. when parsed JSON is forwarded into the find options. A string in that position is appended to the query as is, which allows reading data the query was not meant to return, including hidden properties and other tables. On drivers that send several statements in one query, it also allows running additional statements.
All SQL drivers are affected. The same string passed as where is handled as a primary key value and is not affected.
Not affected:
having themselves or do not use it,qb.having() on the QueryBuilder, which is documented to accept a raw SQL string.| Line | Package | Affected versions |
|---|---|---|
| v7 | @mikro-orm/sql | <= 7.2.12 |
| v6 | @mikro-orm/knex | <= 6.6.19 |
Fixed in 7.2.13 and 6.6.20.
Do not pass request data to the having option, or verify it is a plain object first.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."