<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>TypeORM - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/typeorm/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Mon, 24 Aug 2026 18:03:44 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/typeorm/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>TypeORM SelectQueryBuilder SQL Injection Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2026-08-typeorm-sql-injection/</link><pubDate>Mon, 24 Aug 2026 18:03:44 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-08-typeorm-sql-injection/</guid><description>TypeORM is vulnerable to SQL injection via the SelectQueryBuilder.distinctOn method due to improper input validation and escaping, allowing for unauthorized data exfiltration through injected subqueries.</description><content:encoded><![CDATA[<p>TypeORM is susceptible to SQL injection (CVE-2026-76848) within its SelectQueryBuilder.distinctOn method when utilizing PostgreSQL-family database drivers. The underlying vulnerability exists in src/query-builder/SelectQueryBuilder.ts, where the createSelectDistinctExpression function joins and interpolates user-provided array elements directly into a SQL statement. Unlike other methods in the query builder that utilize identifier validation or driver-specific escaping, distinctOn bypasses these security controls, including the allowlist checks used by orderBy.</p>
<p>When an application allows client-controlled data to be passed into distinctOn, an attacker can supply arbitrary SQL fragments, including correlated subqueries. This provides a mechanism for attackers to perform blind SQL injection, exfiltrating data the application's database role can access through boolean or time-based inference. Because this occurs within a parenthesized SQL expression list, the impact is significant for any Node.js application relying on TypeORM for database interactions that dynamically handles query parameters from user inputs.</p>
<h2 id="impact">Impact</h2>
<p>The vulnerability allows unauthorized access to data stored in the database, potentially leading to full information disclosure if the application database role has sufficient permissions. An attacker can use this flaw to exfiltrate data from any reachable table by observing the timing or boolean responses of the application. This affects any application using TypeORM that dynamically generates distinct-on clauses based on untrusted user input.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Audit all occurrences of SelectQueryBuilder.distinctOn in the codebase to identify instances where user-controlled input is passed directly to the function.</li>
<li>Implement strict input validation or mapping to a static allowlist of column names before passing values to distinctOn.</li>
<li>Upgrade TypeORM to a patched version once released by the maintainers that ensures input sanitization or proper escaping within the distinctOn method.</li>
<li>Review database role permissions to ensure the application follows the principle of least privilege, minimizing the blast radius of a successful SQL injection attack.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category></item></channel></rss>