Vulnerability · Published Aug 12, 2022 · Assigned by GitHub_M

CVE-2022-35956update_by_case before 0.1.3 vulnerable to sql injection

Medium 5.8

In plain English

A medium-severity SQL injection in activerecord-update-by-case from camilova. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 51% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.8Medium
Exploit odds (30 days)0.6%top 48.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 >= 0.1.3 that uses `Arel` instead to construct the resulting sql statement, with sanitized sql.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
RubyGemsupdate_by_case0.1.3GHSA-33wh-w4m7-c6r8

Affected products (as reported)

VendorProductVersions
camilova activerecord-update-by-case < 0.1.3

Weakness: CWE-89 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L

References