Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. update_by_case
  4. ›
  5. CVE-2022-35956

CVE-2022-35956: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

August 12, 2022 (updated August 16, 2022)

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.

References

  • github.com/advisories/GHSA-33wh-w4m7-c6r8
  • github.com/camilova/activerecord-update-by-case/releases/tag/v0.1.3-stable
  • github.com/camilova/activerecord-update-by-case/security/advisories/GHSA-33wh-w4m7-c6r8
  • nvd.nist.gov/vuln/detail/CVE-2022-35956

Code Behaviors & Features

Detect and mitigate CVE-2022-35956 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.1.3

Fixed versions

  • 0.1.3

Solution

Upgrade to version 0.1.3 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Source file

gem/update_by_case/CVE-2022-35956.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:51 +0000.