CVE-2022-35956
CRITICAL 9.8CVSS 3.1update_by_case before 0.1.3 can be vulnerable to sql injection
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.
- Published
- 12 Aug 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-89
- Also known as
- GHSA-33wh-w4m7-c6r8
- Sources
- NVDJSONOSV GHSA-33wh-w4m7-c6r8JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | update_by_case_project | update_by_casecpe:2.3:a:update_by_case_project:update_by_case:*:*:*:*:*:ruby:*:* |
< 0.1.3 | 0.1.3 |
| OSV | RubyGems | update_by_case | < 0.1.3 | 0.1.3 |
References
- https://github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable · Release Notes, Third Party Advisory, WEB
- https://github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8 · Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-35956 · ADVISORY
- https://github.com/camilova/activerecord-update-by-case · PACKAGE
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/update_by_case/CVE-2022-35956.yml · WEB
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 12 Aug 2022)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 11 Aug 2022)