CVE catalog

CVE-2021-21289

ruby-mechanize: CVE-2021-21289

[CVE catalog]

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.

DistributionPackageReleaseVersionStatus
Debianruby-mechanizesid2.14.1-1fixed
Debianruby-mechanizeforky2.14.1-1fixed
Debianruby-mechanizetrixie2.10.1-1fixed
Debianruby-mechanizebookworm2.8.5-1fixed
Ubunturuby-mechanize16.042.7.3-1vulnerable
Ubunturuby-mechanize18.042.7.5-1vulnerable
Ubunturuby-mechanize18.042.7.5-2vulnerable
Ubunturuby-mechanize20.042.7.6-1vulnerable
Ubunturuby-mechanize22.042.7.7-1vulnerable
Ubunturuby-mechanize22.042.7.7-3vulnerable

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debianruby-mechanizesourcesid2.7.7-1not yet assignedNot reportedNot reported
Debianruby-mechanizesourceforky2.7.7-1not yet assignedNot reportedNot reported
Debianruby-mechanizesourcetrixie2.7.7-1not yet assignedNot reportedNot reported
Debianruby-mechanizesourcebookworm2.7.7-1not yet assignedNot reportedNot reported

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • Details (2)
    • 2.8.5-1 · all · bookworm

      Fixed · Fixed: 2.7.7-1

      dsa · ruby-mechanize · debian · bookworm; dsa · ruby-mechanize · debian · 12

    • 2.8.5-1 · all · bookworm

      Fixed · Fixed: 2.7.7-1

      dsa · ruby-mechanize · debian · bookworm; dsa · ruby-mechanize · debian · 12

[Debian 13 (Trixie)]

  • Details (2)
    • 2.10.1-1 · all · trixie

      Fixed · Fixed: 2.7.7-1

      dsa · ruby-mechanize · debian · 13

    • 2.10.1-1 · all · trixie

      Fixed · Fixed: 2.7.7-1

      dsa · ruby-mechanize · debian · 13

Observed:

References