CVE-2026-73651 TypeORM: migration:generate template-literal code injection

Medium 5.7 Published Updated

Attackers with database schema write access can inject code via metadata, leading to execution when migrations are generated and loaded.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-73651?

CVE-2026-73651 is a medium-severity code injection vulnerability in typeorm, published on 13 Aug 2026. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official description

TypeORM is a TypeScript and JavaScript ORM for Node.js that supports PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, and other databases. Prior to versions 0.3.31 and 1.1.0, typeorm migration:generate embeds database schema metadata into JavaScript or TypeScript template literals in src/commands/MigrationGenerateCommand.ts, escaping backticks but not ${...} interpolation. An attacker with database schema write access can place a payload in column COMMENT or DEFAULT metadata, or another introspected schema string, and the JavaScript engine evaluates the payload when the generated migration is loaded through migration:run, import, or require. This issue is fixed in versions 0.3.31 and 1.1.0.

Weakness: CWE-94

Which versions are affected by CVE-2026-73651?

4 open source packages ship an affected version, including typeorm.

PackageAffectedFixed in
typeorm npmAll versions0.3.31
typeorm npmAll versions0.3.31
typeorm npmFrom 1.0.01.1.0
typeorm npmFrom 1.0.01.1.0

How do I fix CVE-2026-73651?

Upgrade typeorm to a fixed version for your release line: 0.3.31 or 1.1.0.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-73651 being exploited?

There is no known exploitation of CVE-2026-73651 in the wild and no public exploit code.

Sources

Also known as GHSA-2rp8-mm9q-fp49, MINI-xm3q-cpv7-3r5g, ROOT-APP-NPM-GHSA-2rp8-mm9q-fp49.

Is CVE-2026-73651 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free