typeorm npm Package Under Investigation for Critical Vulnerability
The typeorm npm package is under investigation for a critical vulnerability that reportedly allows arbitrary code execution through insufficient escaping of template literals in generated migration files.
What happened
An early warning has been issued regarding a critical vulnerability in the typeorm npm package. The issue appears to stem from the embedding of database schema metadata into JavaScript/TypeScript template literals, which may allow an attacker with the ability to write schema metadata to execute arbitrary code. This vulnerability is due to insufficient escaping of template literals in the generated migration files.
Affected versions of typeorm include those introduced from version 0 and fixed in version 0.3.31, as well as other specific version ranges detailed in the primary sources. It is recommended to upgrade to the latest version of typeorm that includes the fix for this issue and to review any existing migrations for potential injection points.
Professionals assessing their exposure should consult the primary sources for detailed version information and recommended actions. The severity of this vulnerability is high, and immediate action is advised to mitigate potential risks.
How 0Day mitigates this
typeorm is anywhere in your dependency tree, the engineers who own the affected repositories get a push alert the moment it is flagged — no manual audit to remember to run.Read how this differs from waiting on a scanner to catch a known advisory, or see the exact, read-only access 0Day needs to do this for an organization.