{"id":"CVE-2022-35956","summary":"update_by_case before 0.1.3 vulnerable to sql injection","details":"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 \u003e= 0.1.3 that uses `Arel` instead to construct the resulting sql statement, with sanitized sql.","aliases":["GHSA-33wh-w4m7-c6r8"],"modified":"2026-08-12T03:51:31.826123037Z","published":"2022-08-12T20:50:08Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-89"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35956.json"},"references":[{"type":"WEB","url":"https://github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35956.json"},{"type":"ADVISORY","url":"https://github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35956"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/camilova/activerecord-update-by-case","events":[{"introduced":"0"},{"fixed":"31c44b7837537121cc43cb2f896954fe115d1d06"}],"database_specific":{"cpe":"cpe:2.3:a:update_by_case_project:update_by_case:*:*:*:*:*:ruby:*:*","extracted_events":[{"introduced":"0"},{"fixed":"0.1.3"}],"source":["AFFECTED_FIELD","CPE_RANGE","REFERENCES"]}}],"versions":["v0.1.2-stable"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-35956.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L"}]}