CVE-2022-33171
JavaScript vulnerability analysis and mitigation

Overview

CVE-2022-33171 affects TypeORM before version 0.3.0. The vulnerability exists in the findOne function, which can accept either a string or a FindOneOptions object as input. When the function receives a user-controlled parsed JSON object, supplying a crafted FindOneOptions instead of an id string can lead to SQL injection (MITRE CVE, NVD). This vulnerability is disputed as the vendor's position is that the user's application is responsible for input validation.

Technical details

The vulnerability exists in the findOne and findOneOrFail methods of TypeORM. These methods are designed to accept either a string ID or a FindOneOptions object. When user-controlled input is passed as a JSON object, it can be interpreted as FindOneOptions instead of a simple ID string, allowing for SQL injection through crafted where clauses (FullDisclosure). The issue was addressed in version 0.3.0 by changing the API design of these methods.

Impact

When exploited, this vulnerability could allow attackers to perform SQL injection attacks against applications using TypeORM. This could lead to unauthorized data access, data manipulation, or execution of arbitrary SQL commands on the underlying database (FullDisclosure).

Mitigation and workarounds

The primary mitigation is to upgrade to TypeORM version 0.3.0 or later, which addresses this issue through API changes. For systems that cannot upgrade, proper input validation should be implemented to ensure that only expected ID strings are passed to the findOne and findOneOrFail methods (MITRE CVE).

Community reactions

The vulnerability has been disputed by the vendor, who maintains that proper input validation is the responsibility of the application developer. This position has been supported by some security firms, including Snyk, who took the author's position on the matter (FullDisclosure).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23947CRITICAL9.3
  • JavaScriptJavaScript
  • @orval/core
NoYesJan 20, 2026
CVE-2026-23950HIGH8.8
  • JavaScriptJavaScript
  • grafana-graphite
NoYesJan 20, 2026
CVE-2026-22037HIGH8.4
  • JavaScriptJavaScript
  • @fastify/express
NoYesJan 19, 2026
CVE-2026-23522LOW3.7
  • JavaScriptJavaScript
  • @lobehub/chat
NoNoJan 19, 2026
CVE-2025-66803LOW1.7
  • JavaScriptJavaScript
  • @hotwired/turbo
NoYesJan 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management