CVE-2021-21289 Command Injection Vulnerability in Mechanize
- 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.
| Package | Affected | Fixed in |
|---|---|---|
mechanize RubyGems | From 2.0.0 | 2.7.7 |
mechanize RubyGems | From 2.0.0 | 2.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.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as DEBIAN-CVE-2021-21289, DLA-2561-1, GHSA-qrqm-fpv6-6r8g, MGASA-2021-0124, UBUNTU-CVE-2021-21289.