SQL Injection Affecting activerecord package, versions >=6.0.0, <22.214.171.124 >=6.1.0, <126.96.36.199 >=7.0.0, <188.8.131.52
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.Test your applications
- Snyk ID SNYK-RUBY-ACTIVERECORD-3237236
- published 19 Jan 2023
- disclosed 18 Jan 2023
- credit kurt-r2c
How to fix?
activerecord to version 184.108.40.206, 220.127.116.11, 18.104.22.168 or higher.
activerecord is a library for databases on Rails.
Affected versions of this package are vulnerable to SQL Injection due to improper sanitization of comments passed via
optimzer_hints methods, or via the
QueryLogs interface, which adds annotations automatically. Exploiting this behavior allows a malicious user to inject SQL outside of the comment.
Avoid passing user input to annotate and avoid using QueryLogs configuration, which can include user input.