Vulnerability Name:

CVE-2021-21289 (CCN-196067)

Assigned:2020-12-22
Published:2021-02-01
Updated:2022-04-26
Summary: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.
CVSS v3 Severity:8.3 High (CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H)
7.2 High (Temporal CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Network
Attack Complexity (AC): High
Privileges Required (PR): None
User Interaction (UI): Required
Scope:Scope (S): Changed
Impact Metrics:Confidentiality (C): High
Integrity (I): High
Availibility (A): High
9.8 Critical (CCN CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
8.5 High (CCN Temporal CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Network
Attack Complexity (AC): Low
Privileges Required (PR): None
User Interaction (UI): None
Scope:Scope (S): Unchanged
Impact Metrics:Confidentiality (C): High
Integrity (I): High
Availibility (A): High
CVSS v2 Severity:7.6 High (CVSS v2 Vector: AV:N/AC:H/Au:N/C:C/I:C/A:C)
Exploitability Metrics:Access Vector (AV): Network
Access Complexity (AC): High
Authentication (Au): None
Impact Metrics:Confidentiality (C): Complete
Integrity (I): Complete
Availibility (A): Complete
10.0 High (CCN CVSS v2 Vector: AV:N/AC:L/Au:N/C:C/I:C/A:C)
Exploitability Metrics:Access Vector (AV): Network
Access Complexity (AC): Low
Athentication (Au): None
Impact Metrics:Confidentiality (C): Complete
Integrity (I): Complete
Availibility (A): Complete
Vulnerability Type:CWE-78
CWE-78
Vulnerability Consequences:Gain Access
References:Source: MITRE
Type: CNA
CVE-2021-21289

Source: XF
Type: UNKNOWN
mechanize-cve202121289-command-exec(196067)

Source: MISC
Type: Patch, Third Party Advisory
https://github.com/sparklemotion/mechanize/commit/66a6a1bfa653a5f13274a396a5e5441238656aa0

Source: MISC
Type: Release Notes, Third Party Advisory
https://github.com/sparklemotion/mechanize/releases/tag/v2.7.7

Source: CCN
Type: Mechanize GIT Repository
Command Injection Vulnerability

Source: CONFIRM
Type: Third Party Advisory
https://github.com/sparklemotion/mechanize/security/advisories/GHSA-qrqm-fpv6-6r8g

Source: MLIST
Type: Mailing List, Third Party Advisory
[debian-lts-announce] 20210216 [SECURITY] [DLA 2561-1] ruby-mechanize security update

Source: FEDORA
Type: Mailing List, Third Party Advisory
FEDORA-2021-24fdc228e4

Source: FEDORA
Type: Mailing List, Third Party Advisory
FEDORA-2021-db8ebc547e

Source: MISC
Type: Product, Third Party Advisory
https://rubygems.org/gems/mechanize/

Source: GENTOO
Type: Third Party Advisory
GLSA-202107-17

Vulnerable Configuration:Configuration 1:
  • cpe:/a:mechanize_project:mechanize:*:*:*:*:*:ruby:*:* (Version >= 2.0 and < 2.7.7)

  • Configuration 2:
  • cpe:/o:fedoraproject:fedora:32:*:*:*:*:*:*:*
  • OR cpe:/o:fedoraproject:fedora:33:*:*:*:*:*:*:*

  • Configuration 3:
  • cpe:/o:debian:debian_linux:9.0:*:*:*:*:*:*:*

  • * Denotes that component is vulnerable
    BACK
    mechanize_project mechanize *
    fedoraproject fedora 32
    fedoraproject fedora 33
    debian debian linux 9.0