What’s Vulnerable › Vulnerabilities
CVE-2022-35956: update_by_case before 0.1.3 vulnerable to sql injection
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.6% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-08-12 · updated 2026-06-17
- Weakness: CWE-89
Description
This Rails gem adds two methods to the ActiveRecord::Base class that allow you to update many records on a single database hit, using a case sql statement for it. Before version 0.1.3 `update_by_case` gem used custom sql strings, and it was not sanitized, making it vulnerable to sql injection. Upgrade to version >= 0.1.3 that uses `Arel` instead to construct the resulting sql statement, with sanitized sql.
Affected products
- camilova activerecord-update-by-case: before 0.1.3 — fixed in 0.1.3
How to fix
Upgrade to a fixed version: camilova activerecord-update-by-case 0.1.3. Check the vendor advisory for mitigations.
References
- https://github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable
- https://github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8
- https://github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable
- https://github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8
Get alerted when CVE-2022-35956 or the next vulnerability affects your stack