Skip to content

Update dependency typeorm to v0.3.26 [SECURITY]#379

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

Update dependency typeorm to v0.3.26 [SECURITY]#379
renovate[bot] wants to merge 1 commit into
developfrom
renovate/npm-typeorm-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Dec 5, 2025

This PR contains the following updates:

Package Change Age Confidence
typeorm (source) 0.3.200.3.26 age confidence

TypeORM 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:

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.

Severity

  • CVSS Score: 8.9 / 10 (High)
  • Vector String: 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:P

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


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: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, 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 Dec 5, 2025
@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Dec 5, 2025

Branch automerge failure

This PR was configured for branch automerge. However, this is not possible, so it has been raised as a PR instead.

@renovate renovate Bot force-pushed the renovate/npm-typeorm-vulnerability branch from 49d2af6 to 49f8cec Compare December 31, 2025 14:56
@renovate renovate Bot force-pushed the renovate/npm-typeorm-vulnerability branch from 49f8cec to 6a4cf91 Compare February 12, 2026 11:27
@renovate renovate Bot force-pushed the renovate/npm-typeorm-vulnerability branch from 6a4cf91 to b5bde3a Compare March 5, 2026 20:36
@renovate renovate Bot force-pushed the renovate/npm-typeorm-vulnerability branch from b5bde3a to b593c80 Compare March 14, 2026 17:09
@renovate renovate Bot force-pushed the renovate/npm-typeorm-vulnerability branch 4 times, most recently from 2af9536 to 0033a00 Compare March 20, 2026 03:39
@renovate renovate Bot changed the title chore(deps): update dependency typeorm to v0.3.26 [security] chore(deps): update dependency typeorm to v0.3.26 [security] - abandoned Mar 27, 2026
@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Mar 27, 2026

Autoclosing Skipped

This PR has been flagged for autoclosing. However, it is being skipped due to the branch being already modified. Please close/delete it manually or report a bug if you think this is in error.

@renovate renovate Bot force-pushed the renovate/npm-typeorm-vulnerability branch from 0033a00 to 5a0fe43 Compare March 30, 2026 21:13
@renovate renovate Bot changed the title chore(deps): update dependency typeorm to v0.3.26 [security] - abandoned chore(deps): update dependency typeorm to v0.3.26 [security] Mar 30, 2026
@renovate renovate Bot force-pushed the renovate/npm-typeorm-vulnerability branch from 5a0fe43 to db8bda8 Compare April 5, 2026 13:05
@renovate renovate Bot changed the title chore(deps): update dependency typeorm to v0.3.26 [security] Update dependency typeorm to v0.3.26 [SECURITY] Apr 8, 2026
@renovate renovate Bot changed the title Update dependency typeorm to v0.3.26 [SECURITY] Update dependency typeorm to v0.3.26 [SECURITY] - abandoned Apr 27, 2026
@renovate renovate Bot force-pushed the renovate/npm-typeorm-vulnerability branch from db8bda8 to 2db1eb1 Compare April 27, 2026 23:16
@renovate renovate Bot changed the title Update dependency typeorm to v0.3.26 [SECURITY] - abandoned Update dependency typeorm to v0.3.26 [SECURITY] Apr 27, 2026
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