Live threats

All CVEs / Mechanize Project

CVE-2021-21289Mechanize Project Mechanize

High 8.3 No auth needed

Priority
65
CVSS 3.1
8.3
EPSS
3.5%
probability of exploitation in 30 days · percentile 90
Auth required
No
Published
Feb 2, 2021
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-78
Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Mechanize.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
RubyGems mechanize ≥ 2.0.0 < 2.7.7 2.7.7 gem "mechanize", ">= 2.7.7"

Per OSV / GitHub Advisories (GHSA-qrqm-fpv6-6r8g). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
mechanize_projectmechanize≥ 2.0 < 2.7.7
fedoraprojectfedora32
fedoraprojectfedora33
debiandebian_linux9.0

Official sources

References

Links published by the sources. Open them with care.