CVE-2026-73651
Medium · 5.7CVSS
5.7
EPSS
0.4%
Published
Aug 13, 2026
CISA due date
—
Cloudanix analysis
A database tool can accidentally run attacker-supplied code if someone who can change database descriptions tricks the tool into creating a file that later gets executed.
- Exploitation
- Remote Authenticated
- Attacker needs
- High Privilege
- Complexity
- High
- Impact
- Remote Code Execution
- Component
- Library
- Class
- Command Injection
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
TypeORM's migration:generate command writes unsanitized database schema metadata (such as column COMMENT or DEFAULT values) into JavaScript/TypeScript template literals without escaping ${...} interpolation, allowing arbitrary code execution when the generated migration file is later imported or required.
Why it matters to the business
Attackers who can modify database schema metadata can cause code execution on developer or CI systems that generate and run migrations, potentially leading to supply-chain compromise or unauthorized access to source repositories and build environments.
How an attack unfolds
An attacker with write access to database schema metadata inserts a malicious ${...} expression into a column COMMENT or DEFAULT value. When a developer runs typeorm migration:generate, the payload is embedded into the generated migration file. Later execution of that file via migration:run, import, or require causes the JavaScript engine to evaluate the payload.
How to fix it
Upgrade TypeORM to version 0.3.31 or 1.1.0 (or later) in all Node.js projects. Regenerate any existing migration files created with vulnerable versions after the upgrade. Avoid running migration:generate against untrusted database schemas.
How to confirm the fix worked
Confirm that typeorm package.json version is at least 0.3.31 or 1.1.0. Re-run migration:generate against a test schema containing a column with a ${...} string in its COMMENT and verify the generated file contains an escaped or removed interpolation sequence rather than executable code.
Typical attack path
- Attacker obtains database schema write access
- Attacker places payload inside column COMMENT, DEFAULT, or similar introspected metadata
- Developer or CI pipeline executes typeorm migration:generate against the compromised schema
- Generated migration file containing the unescaped payload is written to disk
- Migration file is loaded via migration:run, import, or require, triggering code execution
How to detect it
Search source repositories and build logs for migration files containing unescaped ${...} sequences in string literals that do not originate from legitimate template usage. Monitor for unexpected code execution or network activity immediately after running typeorm migration:generate or migration:run against external schemas.
What your security team should do
- Immediately upgrade all TypeORM installations to 0.3.31 or 1.1.0
- Audit source control history for migration files generated before the upgrade that contain unescaped template literals
- Restrict database schema modification privileges to trusted principals only
- Add pre-commit or CI checks that scan generated migration files for ${...} patterns outside of legitimate template usage
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-63378 TAKO AI Agent for Okta is a local-first AI agent that helps Okta administrators query… CWE-94
- CVE-2026-63346 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-94
- CVE-2026-63345 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-94
- CVE-2026-63344 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-94
- CVE-2026-62853 ThingLinks is an enterprise IoT platform. CWE-94
- CVE-2026-62284 OSAC operator is a Kubernetes operator. CWE-94
- CVE-2026-116852 Author Remote Code Execution (RCE) in Widget Options <= 4.2.5 versions. CWE-94
- CVE-2026-118635 The The GeoDirectory – WP Business Directory Plugin and Classified Listings Directory… CWE-94