{"id":"CVE-2026-73651","published":"2026-08-13T18:11:14Z","modified":"2026-08-14T18:09:07Z","title":"TypeORM: migration:generate template-literal code injection","vendor":"typeorm","product":"typeorm","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.7,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00392,"percentile":0.34224,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/typeorm/typeorm/security/advisories/GHSA-2rp8-mm9q-fp49","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/typeorm/typeorm/commit/41d1c62fe49f99c3ca916d4d986f61ee9f45d519","tags":["x_refsource_MISC"]},{"url":"https://github.com/typeorm/typeorm/commit/b175f9b8be422edd2a2ac035ba90c3f2ce782dfe","tags":["x_refsource_MISC"]},{"url":"https://github.com/typeorm/typeorm/releases/tag/0.3.31","tags":["x_refsource_MISC"]},{"url":"https://github.com/typeorm/typeorm/releases/tag/1.1.0","tags":["x_refsource_MISC"]}],"priority":{"score":10.8,"factors":[{"name":"EPSS percentile","points":6.84},{"name":"CVSS severity","points":3.99}]},"vendorSlug":"typeorm","affectedVersions":[{"vendor":"typeorm","product":"typeorm","versions":["< 0.3.31",">= 1.0.0, < 1.1.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-08-14T17:53:43.799793Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"typeorm","vulnerableRanges":["<0.3.31",">=1.0.0, <1.1.0"],"patched":["0.3.31","1.1.0"],"from":["GHSA-2rp8-mm9q-fp49"],"provenance":"source"}],"summary":{"text":"TypeORM, a TypeScript and JavaScript ORM for Node.js, has a code injection flaw in the migration:generate command (src/commands/MigrationGenerateCommand.ts), where schema metadata is embedded into generated migration template literals without escaping ${...} interpolation. An attacker needs high privileges, specifically write access to the database schema, and user interaction, since the payload executes when the generated migration is loaded via migration:run, import, or require and must be placed in column COMMENT or DEFAULT metadata or another introspected schema string.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:01:12Z"},"euvd":{"id":"EUVD-2026-58194","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2020-8158","published":"2020-09-18","fixed":"0.2.25","kev":false},{"cve":"CVE-2022-33171","published":"2022-07-04","fixed":"0.3.0","kev":false},{"cve":"CVE-2025-60542","published":"2025-10-29","fixed":"0.3.26","kev":false,"link":{"from":"CVE-2025-60542","to":"CVE-2026-73651","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:typeorm","fromFixed":"0.3.26","toFixed":"0.3.31","daysApart":288}]}},{"cve":"CVE-2026-73651","published":"2026-08-13","fixed":"1.1.0","kev":false}],"package":"npm:typeorm"}}