cbcvebase.
CVE-2021-21305
published 2021-02-08

CVE-2021-21305: CarrierWave is an open-source RubyGem which provides a simple and flexible way to upload files from Ruby applications. In CarrierWave before versions 1.3.2 and…

PriorityP264high8.8CVSS 3.1
AVNACLPRLUINSUCHIHAH
EPSS
12.68%
95.8th percentile
CarrierWave is an open-source RubyGem which provides a simple and flexible way to upload files from Ruby applications. In CarrierWave before versions 1.3.2 and 2.1.1, there is a code injection vulnerability. The "#manipulate!" method inappropriately evals the content of mutation option(:read/:write), allowing attackers to craft a string that can be executed as a Ruby code. If an application developer supplies untrusted inputs to the option, it will lead to remote code execution(RCE). This is fixed in versions 1.3.2 and 2.1.1.

Affected

7 ranges
VendorProductVersion rangeFixed in
carrierwave_projectcarrierwave< 1.3.21.3.2
carrierwave_projectcarrierwave>= 0 < 1.3.21.3.2
carrierwave_projectcarrierwave>= 2.0.0 < 2.1.12.1.1
carrierwave_projectcarrierwave>= 2.0.1 < 2.1.12.1.1
carrierwaveuploadercarrierwave< 1.3.21.3.2
carrierwaveuploadercarrierwave
debianruby-carrierwave< ruby-carrierwave 1.3.2-1 (bookworm)ruby-carrierwave 1.3.2-1 (bookworm)

Detection & IOCsextracted from sources · hover to see the quote

  • The vulnerable sink is the `#manipulate!` method in CarrierWave, which unsafely evals the content of the mutation option (:read/:write). Monitor for unexpected Ruby `eval` calls originating from CarrierWave's manipulate! method with attacker-controlled option strings.
  • Flag applications passing untrusted/user-supplied input into CarrierWave's :read or :write mutation options, as this is the direct exploitation vector for RCE.
  • ·Exploitation requires the application developer to pass untrusted user input into the :read/:write mutation options of CarrierWave's #manipulate! method — purely internal/trusted use is not directly exploitable.
  • ·Affected versions are CarrierWave < 1.3.2 and < 2.1.1. Patched versions 1.3.2 and 2.1.1 resolve the issue.

CVSS provenance

nvdv3.18.8HIGHCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
nvdv2.07.5HIGHAV:N/AC:L/Au:N/C:P/I:P/A:P
osv8.8HIGH
vendor_debian7.4HIGH
vendor_ubuntu7.4HIGH
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.