@mikro-orm/entity-generator is vulnerable to Path Traversal
20
Low Risk
The entity generator derives output file names for native enum and routine source files from database-introspected type and routine names without the identifier escaping applied to entity class names. A name containing ../ is joined onto the configured output directory, so running generation against a schema a third party can write to writes files outside the intended path and can overwrite existing .ts files. Combined with the unescaped-literal flaw in the same package it can place injected executable TypeScript over a file the project already imports. The fix normalizes enum and routine names before using them as file names and confines generated files to the project or configured output directory.
You are affected if you are using a version that falls within the vulnerable range and you run the entity generator against a database schema in which an untrusted party can create native enum types or routines.
@mikro-orm/entity-generator is vulnerable to Path Traversal in versions 0.0.1 - 7.1.8.
Upgrade the @mikro-orm/entity-generator 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