CVE-2021-21289 Command Injection Vulnerability in Mechanize

High 7.4 Published Updated
Exploited in the wild
Not known
Fix
Available

What is CVE-2021-21289?

CVE-2021-21289 is a high-severity vulnerability in Debian Debian Linux, published on 2 Feb 2021.

Official description

Mechanize is an open-source ruby library that makes automated web interaction easy. In Mechanize from version 2.0.0 and before version 2.7.7 there is a command injection vulnerability. Affected versions of mechanize allow for OS commands to be injected using several classes' methods which implicitly use Ruby's Kernel.open method. Exploitation is possible only if untrusted input is used as a local filename and passed to any of these calls: Mechanize::CookieJar#load, Mechanize::CookieJar#save_as, Mechanize#download, Mechanize::Download#save, Mechanize::File#save, and Mechanize::FileResponse#read_body. This is fixed in version 2.7.7.

Weakness: CWE-78

Which versions are affected by CVE-2021-21289?

2 open source packages ship an affected version, including mechanize. It affects 3 products.

PackageAffectedFixed in
mechanize RubyGemsFrom 2.0.02.7.7
mechanize RubyGemsFrom 2.0.02.7.7

Products include Debian Debian Linux, Fedoraproject Fedora, Mechanize Project Mechanize.

How do I fix CVE-2021-21289?

Upgrade mechanize to 2.7.7 or later.

Is CVE-2021-21289 being exploited?

There is no known exploitation of CVE-2021-21289 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-21289, DLA-2561-1, GHSA-qrqm-fpv6-6r8g, MGASA-2021-0124, UBUNTU-CVE-2021-21289.

Is CVE-2021-21289 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free