Skip to content

fix(deps): update dependency typeorm to ^0.3.26 [security]#26

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

fix(deps): update dependency typeorm to ^0.3.26 [security]#26
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-typeorm-vulnerability

Conversation

@renovate
Copy link

@renovate renovate bot commented Mar 21, 2024

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
typeorm (source) ^0.2.32^0.3.26 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

GitHub Vulnerability Alerts

CVE-2022-33171

The findOne function in TypeORM before 0.3.0 can either be supplied with a string or a FindOneOptions object. When input to the function is a user-controlled parsed JSON object, supplying a crafted FindOneOptions instead of an id string leads to SQL injection. NOTE: the vendor's position is that the user's application is responsible for input validation.

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

v0.3.20

Compare Source

Bug Fixes
Features
Reverts

v0.3.19

Compare Source

Bug Fixes
  • fixed Cannot read properties of undefined (reading 'sync') caused after glob package upgrade

v0.3.18

Compare Source

Bug Fixes
Features
Performance Improvements
BREAKING CHANGES
  • With node-oracledb the thin client is used as default. Added a option to use the thick client. Also added the option to specify the instant client lib
  • MongoDB: from the previous behavior of returning a result with metadata describing when a document is not found.
    See: https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_6.0.0.md
  • new nullable embeds feature introduced a breaking change which might enforce you to update types on your entities to | null,
    if all columns in your embed entity are nullable. Since database queries now return embedded property as null if all its column values are null.

v0.3.17

Compare Source

Bug Fixes

v0.3.16

Compare Source

Bug Fixes
Features
Reverts

v0.3.15

Compare Source

Bug Fixes
  • make cache optional fields optional (#​9942) (159c60a)
  • prevent unique index identical to primary key (all sql dialects) (#​9940) (51eecc2)
  • SelectQueryBuilder builds incorrectly escaped alias in Oracle when used on entity with composite key (#​9668) (83c6c0e)
Features

v0.3.14

Compare Source

Bug Fixes

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 force-pushed the renovate/npm-typeorm-vulnerability branch from 2887857 to 37022f1 Compare October 31, 2025 22:27
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Oct 31, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 37022f1 to 02fa321 Compare November 10, 2025 15:11
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Nov 10, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 02fa321 to 573c41c Compare November 11, 2025 02:03
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Nov 11, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 573c41c to 54be7e5 Compare November 18, 2025 16:12
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Nov 18, 2025
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Nov 19, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 54be7e5 to 558ede7 Compare November 19, 2025 01:37
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 558ede7 to 32ed9d1 Compare December 3, 2025 17:46
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Dec 3, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 32ed9d1 to 1742e01 Compare December 3, 2025 20:59
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Dec 3, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 1742e01 to de53361 Compare December 30, 2025 14:42
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Dec 30, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from de53361 to f17aca7 Compare December 30, 2025 18:52
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Dec 30, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from f17aca7 to 6101f9a Compare December 31, 2025 14:33
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Dec 31, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 6101f9a to 415e26e Compare December 31, 2025 19:00
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Dec 31, 2025
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 415e26e to 0365c35 Compare January 8, 2026 17:43
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Jan 8, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 0365c35 to 8c0f913 Compare January 8, 2026 23:09
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Jan 8, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 8c0f913 to 0235f3f Compare January 19, 2026 18:58
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Jan 19, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 0235f3f to b3af4cc Compare January 19, 2026 21:04
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Jan 19, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from b3af4cc to 7919ad6 Compare February 2, 2026 15:04
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Feb 2, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 7919ad6 to d9b2793 Compare February 2, 2026 18:06
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Feb 2, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from d9b2793 to 7b73117 Compare February 12, 2026 15:33
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Feb 12, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 7b73117 to 4b9fb69 Compare February 12, 2026 18:51
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Feb 12, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 4b9fb69 to 33c4bf1 Compare February 16, 2026 13:01
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Feb 16, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 33c4bf1 to 829c375 Compare February 16, 2026 18:48
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Feb 16, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 829c375 to 84a46d9 Compare February 17, 2026 15:52
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Feb 17, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 84a46d9 to d192fd2 Compare February 17, 2026 21:15
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Feb 17, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from d192fd2 to 989c5d8 Compare March 5, 2026 14:59
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Mar 5, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 989c5d8 to 7de6a25 Compare March 5, 2026 19:00
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Mar 5, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 7de6a25 to 68e28ed Compare March 13, 2026 16:52
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.26 [security] fix(deps): update dependency typeorm to ^0.3.0 [security] Mar 13, 2026
@renovate renovate bot force-pushed the renovate/npm-typeorm-vulnerability branch from 68e28ed to eb31fa8 Compare March 13, 2026 22:44
@renovate renovate bot changed the title fix(deps): update dependency typeorm to ^0.3.0 [security] fix(deps): update dependency typeorm to ^0.3.26 [security] Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants