Security mailing lists by PureSourceCode

CVE-2021-21289

HIGH 8.3CVSS 3.1

Command Injection Vulnerability in Mechanize

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.

Published
2 Feb 2021
Last modified
10 Sep 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-78
Also known as
GHSA-qrqm-fpv6-6r8g
Sources
NVDJSONOSV GHSA-qrqm-fpv6-6r8gJSON

Scores

SourceScored byVersionScoreVector / decision
NVD nvd@nist.gov (Primary) CVSS 3.1 HIGH 8.3 CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
NVD security-advisories@github.com (Secondary) CVSS 3.1 HIGH 7.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N
OSV GitHub CVSS 3.1 HIGH 7.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N
NVD nvd@nist.gov (Primary) CVSS 2.0 HIGH 7.6 AV:N/AC:H/Au:N/C:C/I:C/A:C

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD mechanize_project mechanize
cpe:2.3:a:mechanize_project:mechanize:*:*:*:*:*:ruby:*:*
>= 2.0, < 2.7.7 2.7.7
NVD fedoraproject fedora
cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*
= 32
NVD fedoraproject fedora
cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*
= 33
NVD debian debian_linux
cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*
= 9.0
OSV RubyGems mechanize >= 2.0.0, < 2.7.7 2.7.7

References

History

  • 25 Nov 2026 20:32 UTC · NVD: first stored (published 2 Feb 2021)
  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 2 Feb 2021)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.