Skip to content

chore(deps): update dependency typeorm to v0.3.26 [security]#607

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-typeorm-vulnerability
Open

chore(deps): update dependency typeorm to v0.3.26 [security]#607
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-typeorm-vulnerability

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Oct 31, 2025

This PR contains the following updates:

Package Change Age Confidence
typeorm (source) 0.3.200.3.26 age confidence

GitHub Vulnerability Alerts

CVE-2025-60542

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:

const { username, city, name} = req.body;
const updateData = {
    username,
    city,
    name,
    id:userId
  }; // Developer aims to only allow above three fields to be updated    
const result = await userRepo.save(updateData);

Intended Payload (non-malicious):

username=myusername&city=Riga&name=Javad

OR

{username:\"myusername\",phone:12345,name:\"Javad\"}

SQL query produced:

UPDATE `user` 
SET `username` = 'myusername', 
    `city` = 'Riga', 
    `name` = 'Javad' 
WHERE `id` IN (1);

Malicious Payload:

username=myusername&city[name]=Riga&city[role]=admin

OR

{username:\"myusername\",city:{name:\"Javad\",role:\"admin\"}}

SQL query produced with Injected Column:

UPDATE `user` 
SET `username` = 'myusername', 
    `city` = `name` = 'Javad', 
    `role` = 'admin' 
WHERE `id` IN (1);

Above query is valid as city = name = Javad is a boolean expression resulting in city = 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.


Release Notes

typeorm/typeorm (typeorm)

v0.3.26

Compare Source

Notes:

  • When using MySQL, TypeORM now connects using stringifyObjects: true, in order to avoid a potential security vulnerability
    in the mysql/mysql2 client libraries. You can revert to the old behavior by setting connectionOptions.extra.stringifyObjects = false.
  • When using SAP HANA, TypeORM now uses the built-in pool from the @sap/hana-client library. The deprecated hdb-pool
    is no longer necessary and can be removed. See https://typeorm.io/docs/drivers/sap/#data-source-options for the new pool options.
Bug Fixes
Features
Performance Improvements

v0.3.25

Compare Source

Bug Fixes
Features

v0.3.24

Compare Source

Bug Fixes
Features
Performance Improvements
  • improve save performance during entities update (15de733)

v0.3.23

Compare Source

⚠️ Note on a breaking change

This release includes a technically breaking change (from this PR) in the behaviour of the delete and update methods of the EntityManager and Repository APIs, when an empty object is supplied as the criteria:

await repository.delete({})
await repository.update({}, { foo: 'bar' })
  • Old behaviour was to delete or update all rows in the table
  • New behaviour is to throw an error: 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:

await repository.createQueryBuilder().delete().execute()
// executes: DELETE FROM table_name
await repository.createQueryBuilder().update().set({ foo: 'bar' }).execute()
// executes: UPDATE table_name SET foo = 'bar'

An alternative method for deleting all rows is to use:

await repository.clear()
// executes: TRUNCATE TABLE table_name
Bug Fixes
Features
Performance Improvements

v0.3.22

Compare Source

Bug Fixes
Features
Reverts

v0.3.21

Compare Source

Bug Fixes
Performance Improvements

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Oct 31, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 814208b to 1c3e2d4 Compare November 11, 2025 02:08
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 1c3e2d4 to c888cc2 Compare November 18, 2025 19:58
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from c888cc2 to d5a5b3d Compare December 3, 2025 17:59
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from d5a5b3d to f1f9ab5 Compare December 31, 2025 14:00
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch 2 times, most recently from 18ac8be to 5b88e64 Compare January 23, 2026 17:34
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 5b88e64 to c46475d Compare February 12, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

Comments