
Cloud Vulnerability DB
A community-led vulnerabilities database
The result cache key for em.find() and em.findOne() is computed from the entity, the query options and the where condition. The methods built on them share it: em.findAll(), the rows of em.findAndCount() and the items of em.findByCursor(). Filters defined on the queried entity are merged into where first, so they are part of the key. Filters defined on related entities are applied later, to the joins and to the populate queries, and neither those conditions nor their parameters (em.setFilterParams()) were part of the key.
Two requests that issue the same cached query with different filter parameters for a related entity therefore share one cache entry. Whichever request populates the entry, all the others get its rows until the entry expires.
Applications are affected when all of the following hold:
cache option) or globally (resultCache.global),em.setFilterParams() (a tenant filter is the typical case) is defined on an entity that is joined or populated, or that is the target of a to-one relation of the queried entity,em.find(Category, {}, { populate: ['products'], cache: 5000 }) with a tenant filter on Product. Within the TTL of the cache entry, a request for another tenant gets the products of the tenant that populated the cache. Both the select-in and the joined loading strategies are affected.
A filter on the target of a to-one relation also decides which rows of the queried entity are returned, so the query does not need a populate hint: with a tenant filter on Author, em.find(Book, {}, { cache: 5000 }) returns the books of the tenant that populated the cache.
It takes no crafted input, just the same query issued by two users within the TTL. The exposure is limited to what that one query loads: its relations, and its own rows in the to-one case. A user cannot choose whose rows they get.
Not affected:filters option (filters: { tenant: { tenant: 1 } }), as the options are part of the key,schema option and the row-level security session context (all three are part of the key),em.count(), including the count of em.findAndCount() and the totalCount of em.findByCursor(),cache: ['name', ttl]), which ignore the query on purpose.| Line | Package | Affected versions |
|---|---|---|
| v7 | @mikro-orm/core | <= 7.2.10 |
| v6 | @mikro-orm/core | <= 6.6.18 |
Fixed in 7.2.11 (#8770) and 6.6.19 (#8772). The cache key now includes the filter parameters whenever the query loads relations.
cache: [`categories-${tenantId}`, ttl].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."