CVE-2021-21289Command Injection Vulnerability in Mechanize
- 7.4HighCVSS base score
- 3.5%Exploitation in 30 daysEPSS · top 10% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
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.
Timeline
ID reserved
By GitHub_M
- 42 days later
· 42 days later
Published
- 4 years later
· 4 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | High7.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N |
| NVDNVD · Modified | 3.1 | High8.3 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 3.5% · top 10% of all CVEs (18 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.4.
Affected products
- affected >= 2.0, < 2.7.7
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- RubyGemsmechanizeGHSA-qrqm-fpv6-6r8g (opens in a new tab)
References
References8
- https://github.com/sparklemotion/mechanize/security/advisories/GHSA-qrqm-fpv6-6r8g (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://rubygems.org/gems/mechanize/ (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/sparklemotion/mechanize/releases/tag/v2.7.7 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/sparklemotion/mechanize/commit/66a6a1bfa653a5f13274a396a5e5441238656aa0 (opens in a new tab)x_refsource_MISCx_transferred
- FEDORA-2021-24fdc228e4 (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-db8ebc547e (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- [debian-lts-announce] 20210216 [SECURITY] [DLA 2561-1] ruby-mechanize security update (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
- GLSA-202107-17 (opens in a new tab)vendor-advisoryx_refsource_GENTOOx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-0569 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-qrqm-fpv6-6r8g (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-21289)Record last updated .