CVE-2026-76848

Source
https://cve.org/CVERecord?id=CVE-2026-76848
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-76848.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-76848
Published
2026-08-24T13:12:03.160Z
Modified
2026-08-27T11:47:36.853784814Z
Severity
  • 8.7 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N CVSS Calculator
Summary
TypeORM 0.2.21 through 1.1.0 SQL Injection via SelectQueryBuilder.distinctOn
Details

TypeORM's SelectQueryBuilder.distinctOn accepts an array of strings and stores it on the expression map without validation. For PostgreSQL-family drivers, createSelectDistinctExpression in src/query-builder/SelectQueryBuilder.ts joins that array and interpolates the result into the generated statement as SELECT DISTINCT ON (values), with no escaping, quoting, identifier validation or allowlist, and without routing the values through replacePropertyNames or the driver's escape helper. Because the interpolation point is a parenthesized SQL expression list rather than an identifier-only position, a supplied element may carry arbitrary expressions, including correlated subqueries. An application that forwards a client-controlled value into distinctOn, for instance to let a caller choose a deduplication column, allows that client to read data anywhere the application's database role can reach through boolean or time-based inference, independently of the entity being queried. validateOrderByCondition, the allowlist check guarding the orderBy family in the same class, is not applied to this path.

Database specific
{
    "cwe_ids": [
        "CWE-89"
    ],
    "cna_assigner": "VulnCheck",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/76xxx/CVE-2026-76848.json"
}
References

Affected packages

Git / github.com/typeorm/typeorm

Affected ranges

Type
GIT
Repo
https://github.com/typeorm/typeorm
Events
Database specific
Show details
{
    "source": "AFFECTED_FIELD",
    "extracted_events": [
        {
            "introduced": "0.2.21"
        },
        {
            "last_affected": "1.1.0"
        }
    ]
}

Affected versions

0.*
0.2.21
0.2.22
0.2.23
0.2.24
0.2.25
0.2.26
0.2.27
0.2.28
0.2.29
0.2.30
0.2.31
0.2.32
0.2.33
0.2.35
0.2.36
0.2.37
0.2.38
0.2.39
0.2.40
0.2.41
0.2.42
0.2.43
0.2.44
0.2.45
0.3.0
0.3.1
0.3.10
0.3.11
0.3.12
0.3.14
0.3.15
0.3.16
0.3.17
0.3.18
0.3.19
0.3.2
0.3.20
0.3.21
0.3.22
0.3.23
0.3.24
0.3.25
0.3.26
0.3.27
0.3.28
0.3.3
0.3.4
0.3.5
0.3.7
0.3.9
1.*
1.0.0
1.1.0
v1.*
v1.0.0-beta.1
v1.0.0-beta.2
v1.0.0-beta.3

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-76848.json"