Failure to sanitize quotes which can lead to sql injection in squel
Critical severity
GitHub Reviewed
Published
Jun 14, 2019
to the GitHub Advisory Database
•
Updated Jan 9, 2023
Description
Reviewed
Jun 14, 2019
Published to the GitHub Advisory Database
Jun 14, 2019
Last updated
Jan 9, 2023
All versions of
squel
are vulnerable to sql injection.The
squel
package does not properly escape user provided input when provided using thesetFields
method. This could lead to sql injection if the query was then executed.Proof of concept demonstrating the injection of a single quote into a generated sql statement from user provided input.
Recommendation
There is no fix at this time and the issue has been reported publicly. Consider using another query builder that provides strong guarantees for input sanitization to prevent sql injection attacks.
References