chore(deps): update dependency typeorm to v0.3.29 [security]#187
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency typeorm to v0.3.29 [security]#187renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
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.
This PR contains the following updates:
0.3.28→0.3.29TypeORM: 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).
Release Notes
typeorm/typeorm (typeorm)
v0.3.29Compare Source
What's Changed
QueryBuilderparameter of type JSDatenot escaped correctly by @alumni in #11867returningoption to update/upsert operations by @naorpeled in #11782New Contributors
Full Changelog: typeorm/typeorm@0.3.28...0.3.29
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.