Intel

AIKIDO-2026-509766

@mikro-orm/entity-generator is vulnerable to Path Traversal

Path TraversalGHSA-mfxv-v6q8-gfrx Published 2 days ago

20

Low Risk

This Affects:

JS@mikro-orm/entity-generator
0.0.1 - 7.1.8
Fixed in 7.1.9
Are you affected? Scan for Free

TL;DR

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.

Who does this affect?

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.

Background info

@mikro-orm/entity-generator is vulnerable to Path Traversal in versions 0.0.1 - 7.1.8.

How to fix this

Upgrade the @mikro-orm/entity-generator library to the patch version.