update_by_case before 0.1.3 vulnerable to sql injection
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-89.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| camilova | activerecord-update-by-case | before 0.1.3 | 0.1.3 | Patch available | CNA |
| — | update_by_case (RubyGems) | before 0.1.3 | 0.1.3 | Patch available | GHSA-33wh-w4m7-c6r8 |
- activerecord-update-by-case Vendorcamilova Affected before 0.1.3 Fixed in 0.1.3 Patch available CNA
- update_by_case (RubyGems) Vendor— Affected before 0.1.3 Fixed in 0.1.3 Patch available GHSA-33wh-w4m7-c6r8
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:update_by_case_project:update_by_case:*:*:*:*:*:ruby:*:* | before 0.1.3 | Vulnerable | Update By Case Project |
- cpe:2.3:a:update_by_case_project:update_by_case:*:*:*:*:*:ruby:*:* Versions before 0.1.3 Vulnerable ·Update By Case Project
Remediation
- Fix · CNA activerecord-update-by-case (camilova) Fixed in 0.1.3
- Fix · GHSA-33wh-w4m7-c6r8 update_by_case (RubyGems) Fixed in 0.1.3 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2022-35956
- 2026-10-03 Alias added: GHSA-33wh-w4m7-c6r8
- 2026-10-28 EPSS moved to the 50th–90th percentile
References
Advisory 3
Sources
- CVE-2022-35956 · CVE Program
- CVE-2022-35956 · NVD
- FIRST EPSS
- GHSA-33wh-w4m7-c6r8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences