CVE-2021-21289
Command Injection Vulnerability in Mechanize
- State
- Published
- Severity
- 7.4 High
- Published
- Feb 2, 2021
- Updated
- Aug 3, 2024
- Reserved
- Dec 22, 2020
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.
Scores
| CVSS | Score | Vector | Source |
|---|---|---|---|
| 3.1 | 7.4 High | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N | GitHub_M |
Weaknesses
- CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Products
| Product | Versions |
|---|---|
mechanizesparklemotion |
|
References
- https://github.com/sparklemotion/mechanize/security/advisories/GHSA-qrqm-fpv6-6r8g
- https://rubygems.org/gems/mechanize/
- https://github.com/sparklemotion/mechanize/releases/tag/v2.7.7
- https://github.com/sparklemotion/mechanize/commit/66a6a1bfa653a5f13274a396a5e5441238656aa0
- FEDORA-2021-24fdc228e4vendor-advisory
- FEDORA-2021-db8ebc547evendor-advisory
- [debian-lts-announce] 20210216 [SECURITY] [DLA 2561-1] ruby-mechanize security updatemailing-list
- GLSA-202107-17vendor-advisory
Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.