Repository navigation
fix(deps): update dependency typeorm to v0.3.31 [security] - #97
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
2 times, most recently
from
November 12, 2025 00:51
67984d0 to
da11c45
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
2 times, most recently
from
November 23, 2025 15:28
610d23b to
e97e8c7
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
December 3, 2025 19:42
e97e8c7 to
f0d3162
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
December 31, 2025 16:56
f0d3162 to
939e952
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
February 12, 2026 11:13
939e952 to
3477a1c
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
March 5, 2026 18:54
3477a1c to
b0e6949
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
March 13, 2026 10:43
b0e6949 to
bda3f2f
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
2 times, most recently
from
March 30, 2026 18:03
bda3f2f to
80811d3
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
April 29, 2026 12:52
80811d3 to
004fc5d
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
May 12, 2026 10:39
004fc5d to
a8e6bb4
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
May 28, 2026 15:39
a8e6bb4 to
2cd0fbe
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
July 12, 2026 12:50
2cd0fbe to
2385d19
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
August 26, 2026 20:43
2385d19 to
452f783
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
October 20, 2026 16:13
452f783 to
1ff60a2
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
November 5, 2026 18:27
1ff60a2 to
e6cf4a6
Compare
renovate
Bot
force-pushed
the
renovate/npm-typeorm-vulnerability
branch
from
November 11, 2026 20:28
e6cf4a6 to
c4711fe
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
0.3.20→0.3.31TypeORM vulnerable to SQL injection via crafted request to repository.save or repository.update
CVE-2025-60542 / GHSA-q2pj-6v73-8rgj
More information
Details
Summary
SQL Injection vulnerability in TypeORM before 0.3.26 via crafted request to repository.save or repository.update due to the sqlstring call using stringifyObjects default to false.
Details
Vulnerable Code:
Intended Payload (non-malicious):
username=myusername&city=Riga&name=JavadOR
{username:\"myusername\",phone:12345,name:\"Javad\"}SQL query produced:
Malicious Payload:
username=myusername&city[name]=Riga&city[role]=adminOR
{username:\"myusername\",city:{name:\"Javad\",role:\"admin\"}}SQL query produced with Injected Column:
Above query is valid as
city=name=Javadis a boolean expression resulting incity= 1 (false). “role” column is injected and updated.Underlying issue was due to TypeORM using mysql2 without specifying a value for the stringifyObjects option. In both mysql and mysql2 this option defaults to false. This option is then passed into SQLString library as false. This results in sqlstring parsing objects in a strange way using objectToValues.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:L/SC:L/SI:H/SA:L/E:PReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
TypeORM: SQL Injection in UpdateQueryBuilder/SoftDeleteQueryBuilder orderBy (MySQL/MariaDB)
GHSA-9ggv-8w38-r7pm
More information
Details
Impact
Blind SQL injection vulnerability in
UpdateQueryBuilderandSoftDeleteQueryBuilderaffecting MySQL and MariaDB users.UpdateQueryBuilderandSoftDeleteQueryBuilder(including theiraddOrderByvariants) do not validate theorderparameter against an allowlist of permitted values (ASC/DESC). The caller-supplied value is stored verbatim and concatenated directly into the generated SQL string without quoting or parameterization.SelectQueryBuilder.orderByperforms this validation correctly; the affected builders do not.If any code path passes user-controlled input to
orderBy/addOrderByon an update or soft-delete query, an attacker can inject arbitrary SQL via the sort direction — even when the column name itself is hardcoded.Demonstrated impact includes:
SLEEP()to infer secret values bit by bit)LIMITpatternsSLEEP()-based query exhaustionCVSS 3.1: 8.6 (High) —
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:LAffected files (relative to commit
73fda419):src/query-builder/UpdateQueryBuilder.ts: lines 383–419 and 718–744src/query-builder/SoftDeleteQueryBuilder.ts: lines 352–388 and 520–546The vulnerability was introduced in commit
03799bd2(v0.1.12) and is present through the latest release (v0.3.28).Patches
A fix has been released in 0.3.29 (1b66c44) and 1.0.0 (93eec63).
Workarounds
Applications can manually validate the
orderargument before passing it toorderByoraddOrderByon update or soft-delete query builders:Do not pass user-controlled values to
orderBy/addOrderByonUpdateQueryBuilderorSoftDeleteQueryBuilderwithout this validation.References
SelectQueryBuilder.orderByfor the correct validation pattern this fix should mirrorSeverity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
TypeORM: migration:generate template-literal code injection
CVE-2026-73651 / GHSA-2rp8-mm9q-fp49
More information
Details
Summary
typeorm migration:generateembeds database schema metadata into JS/TS template literals, escaping backticks but not${...}. An attacker who can write schema metadata (column comments, defaults, view definitions) achieves arbitrary code execution on the host that loads the generated migration.Details
MigrationGenerateCommand.ts(L117-138) wraps each SQL statement in a JS template literal, escaping only backticks:Introspected schema strings reach this sink through driver query runners:
DEFAULT,COMMENT,CHECKconstraints, view definitionsPostgresQueryRunner.ts:1782,L1898,L2287,L4125COLUMN_DEFAULT,COLUMN_COMMENTMysqlQueryRunner.ts:2873-2974,L3580-3583CockroachQueryRunner.tsescapeComment()on each driver strips only null bytes, leaving${...}intact:When the migration file is loaded (
migration:run,import, orrequire), the JS engine evaluates${...}as live interpolation.Affected source:
MigrationGenerateCommand.tsPostgresDriver.tsescapeComment()— PostgresMysqlDriver.tsescapeComment()— MySQLCockroachDriver.tsescapeComment()— CockroachDBConfirmed injection vectors (MySQL):
COMMENTDEFAULTALTER TABLE ... DEFAULT '${...}'; payload appears in generated migrationCHECKconstraintinformation_schema.CHECK_CONSTRAINTSstrips content fromCHECK_CLAUSEViewEntityintrospection; likely exploitable viapg_get_viewdef()Suggested fix: Escape
${to\${(and\\to\\\\) before embedding query strings into template literals, or switch to emitting the SQL as aJSON.stringify()-encoded regular string argument.PoC
Prerequisites:
migration:generateCOMMENT,DEFAULT, or view definition textSteps:
${...}:.tsfile contains unescaped${...}:Output confirms code execution —
idran on the host and its output was interpolated into the SQL:The payload appears in whichever migration direction restores the DB's current state. A malicious DB comment with a clean entity comment places it in
down(). Attacker-influenced entity metadata places it inup(). Either direction executes the code when the method runs.Impact
Code injection / RCE. An attacker with DB schema write access executes arbitrary JavaScript on any machine that generates and loads the migration. This crosses the DB-to-host trust boundary.
CI/CD pipelines that auto-generate and run migrations are the highest-risk target. Any TypeORM user running
migration:generateagainst a database with attacker-influenced schema metadata is affected.Severity
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
typeorm/typeorm (typeorm)
v0.3.31Compare Source
Bug Fixes
require()calls that break bundlers (#12647) (30f9fc7)Full Changelog: typeorm/typeorm@0.3.30...0.3.31
v0.3.30Compare Source
Bug Fixes
Reverts
v0.3.29Compare Source
Bug Fixes
QueryBuilderparameter of type JSDatenot escaped correctly (#11867) (5153436)Features
returningoption to update/upsert operations (#11782) (11d9767)v0.3.28Compare Source
Bug Fixes
findBymethod to MongoEntityManager (#11814) (38715bb)Features
jsonpathcolumn type in PostgreSQL (#11684) (4f05718)v0.3.27Compare Source
Bug Fixes
Features
VirtualColumns to be initially non-selectable (#11586) (22b26d1)Performance Improvements
Reverts
v0.3.26Compare Source
Notes:
stringifyObjects: true, in order to avoid a potential security vulnerabilityin the mysql/mysql2 client libraries. You can revert to the old behavior by setting
connectionOptions.extra.stringifyObjects = false.@sap/hana-clientlibrary. The deprecatedhdb-poolis no longer necessary and can be removed. See https://typeorm.io/docs/drivers/sap/#data-source-options for the new pool options.
Bug Fixes
stringifyObjectsimplicitly (#11574) (d57fe3b)useIndexwhen cloning a QueryExpressionMap (or a QueryBuilder) (#10679) (66ee307), closes #10678 #10678Features
Performance Improvements
v0.3.25Compare Source
Bug Fixes
Features
v0.3.24Compare Source
Bug Fixes
Features
Performance Improvements
v0.3.23Compare Source
This release includes a technically breaking change (from this PR) in the behaviour of the
deleteandupdatemethods of the EntityManager and Repository APIs, when an empty object is supplied as the criteria:Empty criteria(s) are not allowed for the delete/update method.Why?
This behaviour was not documented and is considered dangerous as it can allow a badly-formed object (e.g. with an undefined id) to inadvertently delete or update the whole table.
When the intention actually was to delete or update all rows, such queries can be rewritten using the QueryBuilder API:
An alternative method for deleting all rows is to use:
Bug Fixes
aggregatemethod's generic type to its returned cursor (#10754) (56f1898)Features
Performance Improvements
v0.3.22Compare Source
Bug Fixes
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.