SQL Injection The advisory has been revoked - it doesn't affect any version of package typeorm  (opens in a new tab)


Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
9.06% (93rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about SQL Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-TYPEORM-2940870
  • published5 Jul 2022
  • disclosed5 Jul 2022
  • creditUnknown

Introduced: 5 Jul 2022

CVE-2022-33171  (opens in a new tab)
CWE-89  (opens in a new tab)

Amendment

This was deemed not a vulnerability.

Overview

typeorm is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8).

Affected versions of this package are vulnerable to SQL Injection in the findOne(id) and findOneOrFail(id) functions, when it is passed a malicious FindOneOptions JSON object.

NOTE: The vendor does not consider this a vulnerability since user input should be validated elsewhere.

PoC:

curl -v [http://host/findByIds](http://containerip:4444/findByIds)' -H 'Content-Type: application/json' --data 
'[{"where":"1=1; SELECT pg_sleep(10) --"}]'