Description
The findOne function in TypeORM before 0.3.0 can either be supplied with a string or a FindOneOptions object. When input to the function is a user-controlled parsed JSON object, supplying a crafted FindOneOptions instead of an id string leads to SQL injection.
Recommendation
Update the typeorm package to the latest compatible version. Followings are version details:
- Affected version(s): < 0.3.0
- Patched version(s): 0.3.0
References
Could your website be exposed too?
SmartScanner can check your website for SQL injection in typeORM and gives you actionable findings to investigate.
Start a free scanRelated Issues
- Matrix-appservice-irc vulnerable to sql injection via roomIds argument - CVE-2022-3971
- TypeORM vulnerable to SQL injection via crafted request to repository.save or repository.update - CVE-2025-60542
- @nocobase/database has SQL Injection via String Concatenation through Recursive Eager Loading - CVE-2026-41640
- Command Injection in ungit - CVE-2022-25766


