TypeORM: migration:generate template-literal code injection
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Partial Red Hat: 2 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-94.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| typeorm | typeorm | before 0.3.31; 1.0.0 to before 1.1.0 | 0.3.31, 1.1.0 | Patch available | CNA |
| — | typeorm (npm) | before 0.3.31 | 0.3.31 | Patch available | GHSA-2rp8-mm9q-fp49 |
| — | typeorm (npm) | 1.0.0 to before 1.1.0 | 1.1.0 | Patch available | GHSA-2rp8-mm9q-fp49 |
- typeorm Vendortypeorm Affected before 0.3.31; 1.0.0 to before 1.1.0 Fixed in 0.3.31, 1.1.0 Patch available CNA
- typeorm (npm) Vendor— Affected before 0.3.31 Fixed in 0.3.31 Patch available GHSA-2rp8-mm9q-fp49
- typeorm (npm) Vendor— Affected 1.0.0 to before 1.1.0 Fixed in 1.1.0 Patch available GHSA-2rp8-mm9q-fp49
Remediation
- Fix · CNA typeorm (typeorm) Fixed in 0.3.31, 1.1.0
- Fix · GHSA-2rp8-mm9q-fp49 typeorm (npm) Fixed in 0.3.31 Advisory →
- Fix · GHSA-2rp8-mm9q-fp49 typeorm (npm) Fixed in 1.1.0 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Developer Hub 1 | Affected | No fix yet: Fix deferred |
| Self-service automation portal 2 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-73651
- 2026-10-03 Alias added: GHSA-2rp8-mm9q-fp49
- 2026-10-27 Affected versions changed · Red Hat
References
Other 6
- https://github.com/typeorm/typeorm/security/advisories/GHSA-2rp8-mm9q-fp49
- https://github.com/typeorm/typeorm/commit/41d1c62fe49f99c3ca916d4d986f61ee9f45d519
- https://github.com/typeorm/typeorm/commit/b175f9b8be422edd2a2ac035ba90c3f2ce782dfe
- https://github.com/typeorm/typeorm/releases/tag/0.3.31
- https://github.com/typeorm/typeorm/releases/tag/1.1.0
- https://github.com/typeorm/typeorm
More typeorm vulnerabilities
- TI-2022-14604 The findOne function in TypeORM before 0.3.0 can either be supplied with a string or a… CVSS 3.1CRITICAL 9.8
- TI-2020-06576 Prototype pollution in typeorm CVSS 3.1CRITICAL 9.8
Sources
- CVE-2026-73651 · CVE Program
- CVE-2026-73651 · NVD
- FIRST EPSS
- GHSA-2rp8-mm9q-fp49 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-73651 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences