{"id":"CVE-2022-35956","published":"2022-08-12T20:50:08Z","modified":"2025-04-23T17:50:56Z","title":"update_by_case before 0.1.3 vulnerable to sql injection","vendor":"camilova","product":"activerecord-update-by-case","tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.8,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00649,"percentile":0.52035,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable","tags":["x_refsource_MISC"]}],"priority":{"score":14.5,"factors":[{"name":"EPSS percentile","points":10.41},{"name":"CVSS severity","points":4.06}]},"vendorSlug":"camilova","affectedVersions":[{"vendor":"camilova","product":"activerecord-update-by-case","versions":["< 0.1.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-23T14:02:15.260626Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"update_by_case","vulnerableRanges":["<0.1.3"],"patched":["0.1.3"],"from":["GHSA-33wh-w4m7-c6r8"],"provenance":"source"}],"summary":{"text":"The activerecord-update-by-case Rails gem from camilova contains an SQL injection flaw in its update_by_case methods, which build custom SQL strings without sanitization in versions before 0.1.3. An attacker could inject SQL through the affected update path, and the attack requires network access, with user interaction needed and no prior authentication.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:38:52Z"},"euvd":{"id":"EUVD-2022-6465","exploited":false,"provenance":"source"}}