
Cloud Vulnerability DB
A community-led vulnerabilities database
EntityAssigner.assign(), the implementation behind wrap(entity).assign(data), em.assign(entity, data), entity.assign(data) (via BaseEntity) and repository.assign(entity, data), writes keys that are not entity properties directly onto the entity instance, unless the onlyProperties option is enabled.
A key named like a method of the entity therefore becomes an own property of the instance and replaces that method. For a toJSON key this disables the ORM serialization: JSON.stringify() only calls toJSON when it is a function, so with any other value in its place the entity is serialized as a plain object, with all of its own properties, including those marked as hidden.
Nested payloads go through the same code path. With the default options, a nested object that carries the primary key of an already loaded to-one relation is assigned to that related entity, and the payload of an embedded property is assigned to the embeddable.
Applications are affected when they pass unvalidated user input (such as a request body) to one of the assign() APIs without onlyProperties: true, and then return the same entity instance in the response through JSON.stringify() (e.g. res.json(entity)).
The response then contains the hidden properties, such as a password hash or internal fields, of:
EntityManager, so with a request-scoped EntityManager the effect ends with the request. The key is not persisted, and entities loaded through another EntityManager are not affected.serialize(), wrap(entity).toObject(), em.create() and em.merge() are not affected.
Related: GHSA-v5x2-6hgv-vwwv (same code path).
| Line | Package | Affected versions |
|---|---|---|
| v7 | @mikro-orm/core | >= 7.0.0, <= 7.2.10 |
| v6 | @mikro-orm/core | <= 6.6.18 |
Fixed in 7.2.11 (#8771) and 6.6.19 (#8773). assign() now ignores keys that are not entity properties when they name a method of the entity.
onlyProperties: true to assign(), or set it globally via the assign config option, orassign().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."