CVE-2021-21305Code Injection vulnerability in CarrierWave
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.
What to do
Likely to be exploited: EPSS gives a 13% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.
Fixed builds are available from Debian, RubyGems: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 20.04 | ruby-carrierwave | Fix pending | 1.3.1-2ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-21305 |
| Ubuntu 18.04 | ruby-carrierwave | Fix pending | 1.2.2-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-21305 |
| Ubuntu 16.04 | ruby-carrierwave | Fix pending | UBUNTU-CVE-2021-21305 | |
| Ubuntu 14.04 | ruby-carrierwave | Fix pending | ||
| Debian 12 | ruby-carrierwave | Fixed | 1.3.2-1 | DEBIAN-CVE-2021-21305 |
| RubyGems library | carrierwave | Fixed | 2.1.1 | GHSA-cf3w-g86h-35x4 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- carrierwaveuploader carrierwave: affected: < 1.3.2, >= 2.0.0, < 2.1.1
References
- https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#132---2021-02-08
- https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#211---2021-02-08
- https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4
- https://rubygems.org/gems/carrierwave
- https://github.com/carrierwaveuploader/carrierwave/commit/387116f5c72efa42bc3938d946b4c8d2f22181b7
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.