
CVE catalog
CVE-2021-21289
ruby-mechanize: CVE-2021-21289
- Severity
- Medium
- Published
- Source
- [NVD] · [CVE record]
- EPSS
- 3.51% · Oct 25, 2026
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.
Vulnerable and fixed packages
Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | ruby-mechanize | sid | 2.14.1-1 | fixed |
| Debian | ruby-mechanize | forky | 2.14.1-1 | fixed |
| Debian | ruby-mechanize | trixie | 2.10.1-1 | fixed |
| Debian | ruby-mechanize | bookworm | 2.8.5-1 | fixed |
| Ubuntu | ruby-mechanize | 16.04 | 2.7.3-1 | vulnerable |
| Ubuntu | ruby-mechanize | 18.04 | 2.7.5-1 | vulnerable |
| Ubuntu | ruby-mechanize | 18.04 | 2.7.5-2 | vulnerable |
| Ubuntu | ruby-mechanize | 20.04 | 2.7.6-1 | vulnerable |
| Ubuntu | ruby-mechanize | 22.04 | 2.7.7-1 | vulnerable |
| Ubuntu | ruby-mechanize | 22.04 | 2.7.7-3 | vulnerable |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | ruby-mechanize | source | sid | 2.7.7-1 | not yet assigned | Not reported | Not reported |
| Debian | ruby-mechanize | source | forky | 2.7.7-1 | not yet assigned | Not reported | Not reported |
| Debian | ruby-mechanize | source | trixie | 2.7.7-1 | not yet assigned | Not reported | Not reported |
| Debian | ruby-mechanize | source | bookworm | 2.7.7-1 | not yet assigned | Not reported | Not reported |
OpenFactory catalog packages
[Debian 12 (Bookworm)]
- [ruby-mechanize]Fixed
Details (2)
2.8.5-1· all · bookwormFixed · Fixed:
2.7.7-1dsa · ruby-mechanize · debian · bookworm; dsa · ruby-mechanize · debian · 12
2.8.5-1· all · bookwormFixed · Fixed:
2.7.7-1dsa · ruby-mechanize · debian · bookworm; dsa · ruby-mechanize · debian · 12
[Debian 13 (Trixie)]
- [ruby-mechanize]Fixed
Details (2)
2.10.1-1· all · trixieFixed · Fixed:
2.7.7-1dsa · ruby-mechanize · debian · 13
2.10.1-1· all · trixieFixed · Fixed:
2.7.7-1dsa · ruby-mechanize · debian · 13
Observed: