{"id":"CVE-2022-35956","aliases":["EUVD-2022-6465","GHSA-33wh-w4m7-c6r8"],"status":"published","title":"update_by_case before 0.1.3 vulnerable to sql injection","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 \u003e= 0.1.3 that uses `Arel` instead to construct the resulting sql statement, with sanitized sql.","severity":{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00649,"percentile":0.51379,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-89"],"published":"2022-08-11T21:18:31Z","modified":"2026-10-28T02:30:42Z","fixes":[{"ecosystem":"RubyGems","package":"update_by_case","fixed_in":["0.1.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"RubyGems","package":"update_by_case","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.3"}]}]},{"source":"osv","ecosystem":"RubyGems","package":"update_by_case","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.3"}]}]}],"products":[{"vendor":"camilova","product":"activerecord-update-by-case"},{"vendor":"update_by_case_project","product":"update_by_case"}],"references":[{"url":"https://github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35956","tags":["advisory"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/update_by_case/CVE-2022-35956.yml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-33wh-w4m7-c6r8"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35956.json","tags":["advisory"]},{"url":"https://github.com/camilova/activerecord-update-by-case","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-35956","title":"update_by_case before 0.1.3 vulnerable to sql injection","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 \u003e= 0.1.3 that uses `Arel` instead to construct the resulting sql statement, with sanitized sql.","status":"published","published":"2022-08-12T20:50:08Z","modified":"2025-04-23T17:50:56.051Z","cvss":[{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"medium","assessor":"cna"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:34:39.935681Z"}],"euvd":[{"id":"EUVD-2022-6465","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 \u003e= 0.1.3 that uses `Arel` instead to construct the resulting sql statement, with sanitized sql.","status":"published","published":"2022-08-12T20:50:08Z","modified":"2025-04-23T17:50:56Z","cvss":[{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"medium"}],"updated_at":"2026-11-02T20:52:10.363195Z"}],"ghsa":[{"id":"GHSA-33wh-w4m7-c6r8","title":"update_by_case before 0.1.3 can be vulnerable to sql injection","description":"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.","status":"published","published":"2022-08-11T21:18:31Z","modified":"2023-01-27T05:04:07Z","cvss":[{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:36:20.985872Z"}],"nvd":[{"id":"CVE-2022-35956","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 \u003e= 0.1.3 that uses `Arel` instead to construct the resulting sql statement, with sanitized sql.","status":"published","published":"2022-08-12T21:15:08.113Z","modified":"2026-06-17T04:52:35.877Z","cvss":[{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"medium","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:07:24.750124Z"}],"osv":[{"id":"CVE-2022-35956","title":"update_by_case before 0.1.3 vulnerable to sql injection","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 \u003e= 0.1.3 that uses `Arel` instead to construct the resulting sql statement, with sanitized sql.","status":"published","published":"2022-08-12T20:50:08Z","modified":"2026-10-28T02:30:42.991957366Z","cvss":[{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T15:44:26.195407Z"},{"id":"GHSA-33wh-w4m7-c6r8","title":"update_by_case before 0.1.3 can be vulnerable to sql injection","description":"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.","status":"published","published":"2022-08-11T21:18:31Z","modified":"2023-11-08T04:09:54.202763Z","cvss":[{"version":"3.1","score":5.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T15:46:35.050232Z"}]}}
