CVE-2022-33171

The findOne function in TypeORM before 0.3.0 can either be supplied with a string or a FindOneOptions object

published July 4, 2022

CVSS
—
EPSS
21%
Percentile
97.6
In the wild
Unconfirmed
What it is

⚡ A sneaky SQL injection hides in plain sight! When using TypeORM’s findOne function, a crafted FindOneOptions object can turn user input into a dangerous weapon. 🔥 Think of it like ordering food at a restaurant. If a customer doesn't specify their preferences, the chef might accidentally add an ingredient no one asked for, like hot sauce on a child's meal. Here, the SQL query receives unexpected ingredients from users, leading to unpredictable results! This could allow an attacker to manipulate the database query, potentially exposing sensitive information or altering data. The consequences could range from unauthorized access to data to complete compromise of the application's database. Yikes!

Put simply

Think of it like ordering food at a restaurant. If a customer doesn't specify their preferences, the chef might accidentally add an ingredient no one asked for, like hot sauce on a child's meal. Here, the SQL query receives unexpected ingredients from users, leading to unpredictable results! In TypeORM versions before 0.3.0, the findOne function can accept either a string or a FindOneOptions object. If the latter is user-controlled, it could lead to SQL injection if not properly validated.

What to do

This could allow an attacker to manipulate the database query, potentially exposing sensitive information or altering data. The consequences could range from unauthorized access to data to complete compromise of the application's database. Yikes! Upgrade TypeORM to version 0.3.0 or above to eliminate this vulnerability. Additionally, ensure robust input validation is in place to mitigate the risk of SQL injection caused by user-controlled inputs. You've got this! Fixing this vulnerability is straightforward, and you’ll be a security hero in no time! 🦸

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.21393 · 97.6th percentile
Published
2022-07-04T15:51Z
EPSS history
Timeline
  • 04 JUL 15:51Z
    The findOne function in TypeORM before 0.3.0 can either be supplied with a string or a FindOneOptions object
    cvelistv5