ADVISORIES

Vulnerability

CVE-2021-21289

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.

5 advisories report this vulnerability, across 3 ecosystems.

High severity All Debian 2Ubuntu 2RubyGems 1

Advisories

  • DEBIAN-CVE-2021-21289

    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…

    CVE-2021-21289 Debian Updated 23 October 2026
  • DLA-2561-1

    ruby-mechanize - security update

    CVE-2021-21289 Debian Updated 20 November 2026
  • GHSA-qrqm-fpv6-6r8g

    Command Injection Vulnerability in Mechanize

    High CVE-2021-21289 RubyGems Updated 10 September 2026
  • UBUNTU-CVE-2021-21289

    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…

    CVE-2021-21289 Ubuntu Updated 18 November 2026
  • USN-9148-1

    ruby-mechanize vulnerability

    CVE-2021-21289 Ubuntu Updated 18 November 2026

References