Potential SQL Injection in sequelize
High severity
GitHub Reviewed
Published
Feb 18, 2019
to the GitHub Advisory Database
•
Updated Jan 9, 2023
Description
Published to the GitHub Advisory Database
Feb 18, 2019
Reviewed
Jun 16, 2020
Last updated
Jan 9, 2023
Affected versions of
sequelize
are vulnerable to SQL Injection when user input is passed intofindOne
or into a statement such aswhere: "user input"
.Recommendation
Update to version 3.0.0 or later.
Version 3.0.0 will introduce a number of breaking changes.
Thankfully, the project authors have provided a 2.x -> 3.x upgrade guide to ease this transition.
If upgrading is not an option, it is also possible to mitigate this by ensuring that all uses of
where: "input"
andfindOne("input")
are properly sanitized, such as by the use of a wrapper function.References