# CVE-2022-35956: update_by_case before 0.1.3 vulnerable to sql injection

- Severity: Medium 5.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.65%, higher than 52% of CVEs (2026-12-01)
- Published: 2022-08-11T21:18:31.000Z
- Modified: 2026-06-17T04:52:35.877Z
- Also known as: GHSA-33wh-w4m7-c6r8
- Weaknesses: CWE-89
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- camilova activerecord-update-by-case: < 0.1.3
- update_by_case (RubyGems): before 0.1.3
- update_by_case_project update_by_case: before 0.1.3

## Every score

- GitHub_M: CVSS:3.1 5.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L`
- GitHub: CVSS:3.1 5.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8> (third-party-advisory, web)
- <https://github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable> (release-notes, 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)

## Sources

- CVE List: [CVE-2022-35956](https://www.cve.org/CVERecord?id=CVE-2022-35956), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-33wh-w4m7-c6r8](https://github.com/advisories/GHSA-33wh-w4m7-c6r8), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-35956](https://nvd.nist.gov/vuln/detail/CVE-2022-35956), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-35956 · Whole record: https://cve.day/CVE-2022-35956.json · Rebuilt by cve.day 2026-11-25T22:58:14.183Z
