{"id":"CVE-2022-35956","aliases":["CVE-2022-35956","GHSA-33wh-w4m7-c6r8"],"related":[],"kind":"vulnerability","state":"published","title":"update_by_case before 0.1.3 vulnerable to sql injection","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Esta gema de Rails añade dos métodos a la clase ActiveRecord::Base que permiten actualizar muchos registros en un solo golpe de base de datos, usando una sentencia sql case para ello. En versiones anteriores a 0.1.3, la gema \"update_by_case\" usaba cadenas sql personalizadas, y no estaba saneada, lo que la hacía vulnerable a una inyección sql. Actualice a versiones posteriores a 0.1.3 incluyéndola,  que usa \"Arel\" en su lugar para construir la sentencia sql resultando, con sql saneado.","source":"nvd"}],"published":"2022-08-11T21:18:31.000Z","modified":"2026-06-17T04:52:35.877Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","score":5.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","score":5.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","score":5.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":"< 0.1.3","status":"affected"}],"vendor":"camilova","product":"activerecord-update-by-case","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.3"}],"ecosystem":"RubyGems","package":"update_by_case","purl":"pkg:gem/update_by_case","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.1.3"}],"vendor":"update_by_case_project","product":"update_by_case","cpe":"cpe:2.3:a:update_by_case_project:update_by_case:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35956","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/camilova/activerecord-update-by-case","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/update_by_case/CVE-2022-35956.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-04-23T14:02:15.260Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-35956","url":"https://www.cve.org/CVERecord?id=CVE-2022-35956","licence":"CVE Terms of Use","modified":"2025-04-23T17:50:56.051Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-33wh-w4m7-c6r8","url":"https://github.com/advisories/GHSA-33wh-w4m7-c6r8","licence":"CC-BY-4.0","modified":"2023-11-08T04:09:54.202Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-35956","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35956","licence":"Public domain","modified":"2026-06-17T04:52:35.877Z"}],"updatedAt":"2026-11-25T22:58:14.183Z","epss":{"score":0.00649,"percentile":0.524,"date":"2026-12-01T12:00:22.000Z"}}