gsd-2021-31799
Vulnerability from gsd
Modified
2021-05-02 00:00
Details
RDoc used to call `Kernel#open` to open a local file. If a Ruby project has a file whose name starts with `|` and ends with `tags`, the command following the pipe character is executed. A malicious Ruby project could exploit it to run an arbitrary command execution against a user who attempts to run `rdoc` command.
Aliases



{
  "GSD": {
    "alias": "CVE-2021-31799",
    "description": "In RDoc 3.11 through 6.x before 6.3.1, as distributed with Ruby through 3.0.1, it is possible to execute arbitrary code via | and tags in a filename.",
    "id": "GSD-2021-31799",
    "references": [
      "https://www.suse.com/security/cve/CVE-2021-31799.html",
      "https://www.debian.org/security/2022/dsa-5066",
      "https://access.redhat.com/errata/RHSA-2022:0708",
      "https://access.redhat.com/errata/RHSA-2022:0672",
      "https://access.redhat.com/errata/RHSA-2022:0582",
      "https://access.redhat.com/errata/RHSA-2022:0581",
      "https://access.redhat.com/errata/RHSA-2022:0544",
      "https://access.redhat.com/errata/RHSA-2022:0543",
      "https://access.redhat.com/errata/RHSA-2021:3982",
      "https://access.redhat.com/errata/RHSA-2021:3559",
      "https://access.redhat.com/errata/RHSA-2021:3020",
      "https://ubuntu.com/security/CVE-2021-31799",
      "https://advisories.mageia.org/CVE-2021-31799.html",
      "https://security.archlinux.org/CVE-2021-31799",
      "https://alas.aws.amazon.com/cve/html/CVE-2021-31799.html",
      "https://linux.oracle.com/cve/CVE-2021-31799.html"
    ]
  },
  "gsd": {
    "metadata": {
      "exploitCode": "unknown",
      "remediation": "unknown",
      "reportConfidence": "confirmed",
      "type": "vulnerability"
    },
    "osvSchema": {
      "affected": [
        {
          "package": {
            "ecosystem": "RubyGems",
            "name": "rdoc",
            "purl": "pkg:gem/rdoc"
          }
        }
      ],
      "aliases": [
        "CVE-2021-31799",
        "GHSA-ggxm-pgc9-g7fp"
      ],
      "details": "RDoc used to call `Kernel#open` to open a local file. If a Ruby project has\na file whose name starts with `|` and ends with `tags`, the command following\nthe pipe character is executed. A malicious Ruby project could exploit it to\nrun an arbitrary command execution against a user who attempts to run `rdoc`\ncommand.\n",
      "id": "GSD-2021-31799",
      "modified": "2021-05-02T00:00:00.000Z",
      "published": "2021-05-02T00:00:00.000Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://www.ruby-lang.org/en/news/2021/05/02/os-command-injection-in-rdoc/"
        }
      ],
      "schema_version": "1.4.0",
      "severity": [
        {
          "score": 7.0,
          "type": "CVSS_V3"
        }
      ],
      "summary": "RDoc OS command injection vulnerability"
    }
  },
  "namespaces": {
    "cve.org": {
      "CVE_data_meta": {
        "ASSIGNER": "cve@mitre.org",
        "ID": "CVE-2021-31799",
        "STATE": "PUBLIC"
      },
      "affects": {
        "vendor": {
          "vendor_data": [
            {
              "product": {
                "product_data": [
                  {
                    "product_name": "n/a",
                    "version": {
                      "version_data": [
                        {
                          "version_value": "n/a"
                        }
                      ]
                    }
                  }
                ]
              },
              "vendor_name": "n/a"
            }
          ]
        }
      },
      "data_format": "MITRE",
      "data_type": "CVE",
      "data_version": "4.0",
      "description": {
        "description_data": [
          {
            "lang": "eng",
            "value": "In RDoc 3.11 through 6.x before 6.3.1, as distributed with Ruby through 3.0.1, it is possible to execute arbitrary code via | and tags in a filename."
          }
        ]
      },
      "problemtype": {
        "problemtype_data": [
          {
            "description": [
              {
                "lang": "eng",
                "value": "n/a"
              }
            ]
          }
        ]
      },
      "references": {
        "reference_data": [
          {
            "name": "[debian-lts-announce] 20211013 [SECURITY] [DLA 2780-1] ruby2.3 security update",
            "refsource": "MLIST",
            "url": "https://lists.debian.org/debian-lts-announce/2021/10/msg00009.html"
          },
          {
            "name": "https://www.oracle.com/security-alerts/cpuapr2022.html",
            "refsource": "MISC",
            "url": "https://www.oracle.com/security-alerts/cpuapr2022.html"
          },
          {
            "name": "https://www.ruby-lang.org/en/news/2021/05/02/os-command-injection-in-rdoc/",
            "refsource": "MISC",
            "url": "https://www.ruby-lang.org/en/news/2021/05/02/os-command-injection-in-rdoc/"
          },
          {
            "name": "https://security-tracker.debian.org/tracker/CVE-2021-31799",
            "refsource": "MISC",
            "url": "https://security-tracker.debian.org/tracker/CVE-2021-31799"
          },
          {
            "name": "https://security.netapp.com/advisory/ntap-20210902-0004/",
            "refsource": "CONFIRM",
            "url": "https://security.netapp.com/advisory/ntap-20210902-0004/"
          },
          {
            "name": "GLSA-202401-05",
            "refsource": "GENTOO",
            "url": "https://security.gentoo.org/glsa/202401-05"
          }
        ]
      }
    },
    "github.com/rubysec/ruby-advisory-db": {
      "cve": "2021-31799",
      "cvss_v3": 7.0,
      "date": "2021-05-02",
      "description": "RDoc used to call `Kernel#open` to open a local file. If a Ruby project has\na file whose name starts with `|` and ends with `tags`, the command following\nthe pipe character is executed. A malicious Ruby project could exploit it to\nrun an arbitrary command execution against a user who attempts to run `rdoc`\ncommand.\n",
      "gem": "rdoc",
      "ghsa": "ggxm-pgc9-g7fp",
      "patched_versions": [
        "~\u003e 6.1.2.1",
        "~\u003e 6.2.1.1",
        "\u003e= 6.3.1"
      ],
      "title": "RDoc OS command injection vulnerability",
      "url": "https://www.ruby-lang.org/en/news/2021/05/02/os-command-injection-in-rdoc/"
    },
    "gitlab.com": {
      "advisories": [
        {
          "affected_range": "\u003e=3.11 \u003c6.3.1",
          "affected_versions": "All versions starting from 3.11 before 6.3.1",
          "cvss_v2": "AV:L/AC:M/Au:N/C:P/I:P/A:P",
          "cvss_v3": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
          "cwe_ids": [
            "CWE-1035",
            "CWE-78",
            "CWE-937"
          ],
          "date": "2022-06-28",
          "description": "In RDoc, as distributed with Ruby, it is possible to execute arbitrary code via `|` and tags in a filename.",
          "fixed_versions": [
            "6.3.1"
          ],
          "identifier": "CVE-2021-31799",
          "identifiers": [
            "CVE-2021-31799"
          ],
          "not_impacted": "All versions before 3.11, all versions starting from 6.3.1",
          "package_slug": "gem/rdoc",
          "pubdate": "2021-07-30",
          "solution": "Upgrade to version 6.3.1 or above.",
          "title": "Command Injection",
          "urls": [
            "https://nvd.nist.gov/vuln/detail/CVE-2021-31799",
            "https://www.ruby-lang.org/en/news/2021/05/02/os-command-injection-in-rdoc/"
          ],
          "uuid": "c1e146bd-5e81-474f-977b-b5eb054a63f7"
        }
      ]
    },
    "nvd.nist.gov": {
      "cve": {
        "configurations": [
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*",
                    "matchCriteriaId": "DEECE5FC-CACF-4496-A3E7-164736409252",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*",
                    "matchCriteriaId": "07B237A9-69A3-4A9C-9DA0-4E06BD37AE73",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          },
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:a:ruby-lang:rdoc:*:*:*:*:*:ruby:*:*",
                    "matchCriteriaId": "77236966-D428-48E2-AB70-F9B0F6388CD8",
                    "versionEndExcluding": "6.3.1",
                    "versionStartIncluding": "3.11",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              },
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "C5F4F2D7-4AC8-4DA7-8905-0105CC8B7174",
                    "versionEndIncluding": "3.0.1",
                    "vulnerable": false
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ],
            "operator": "AND"
          },
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:a:oracle:jd_edwards_enterpriseone_tools:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "D1298AA2-0103-4457-B260-F976B78468E7",
                    "versionEndExcluding": "9.2.6.1",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          }
        ],
        "descriptions": [
          {
            "lang": "en",
            "value": "In RDoc 3.11 through 6.x before 6.3.1, as distributed with Ruby through 3.0.1, it is possible to execute arbitrary code via | and tags in a filename."
          },
          {
            "lang": "es",
            "value": "En RDoc versiones 3.11 hasta 6.x versiones anteriores a 6.3.1, como se distribuye con Ruby versiones hasta 3.0.1, es posible ejecutar c\u00f3digo arbitrario por medio de | y etiquetas en un nombre de archivo"
          }
        ],
        "id": "CVE-2021-31799",
        "lastModified": "2024-01-05T14:15:46.040",
        "metrics": {
          "cvssMetricV2": [
            {
              "acInsufInfo": false,
              "baseSeverity": "MEDIUM",
              "cvssData": {
                "accessComplexity": "MEDIUM",
                "accessVector": "LOCAL",
                "authentication": "NONE",
                "availabilityImpact": "PARTIAL",
                "baseScore": 4.4,
                "confidentialityImpact": "PARTIAL",
                "integrityImpact": "PARTIAL",
                "vectorString": "AV:L/AC:M/Au:N/C:P/I:P/A:P",
                "version": "2.0"
              },
              "exploitabilityScore": 3.4,
              "impactScore": 6.4,
              "obtainAllPrivilege": false,
              "obtainOtherPrivilege": false,
              "obtainUserPrivilege": false,
              "source": "nvd@nist.gov",
              "type": "Primary",
              "userInteractionRequired": false
            }
          ],
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "HIGH",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.0,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.0,
              "impactScore": 5.9,
              "source": "nvd@nist.gov",
              "type": "Primary"
            }
          ]
        },
        "published": "2021-07-30T14:15:16.620",
        "references": [
          {
            "source": "cve@mitre.org",
            "tags": [
              "Third Party Advisory"
            ],
            "url": "https://lists.debian.org/debian-lts-announce/2021/10/msg00009.html"
          },
          {
            "source": "cve@mitre.org",
            "tags": [
              "Third Party Advisory"
            ],
            "url": "https://security-tracker.debian.org/tracker/CVE-2021-31799"
          },
          {
            "source": "cve@mitre.org",
            "url": "https://security.gentoo.org/glsa/202401-05"
          },
          {
            "source": "cve@mitre.org",
            "tags": [
              "Third Party Advisory"
            ],
            "url": "https://security.netapp.com/advisory/ntap-20210902-0004/"
          },
          {
            "source": "cve@mitre.org",
            "tags": [
              "Patch",
              "Third Party Advisory"
            ],
            "url": "https://www.oracle.com/security-alerts/cpuapr2022.html"
          },
          {
            "source": "cve@mitre.org",
            "tags": [
              "Patch",
              "Vendor Advisory"
            ],
            "url": "https://www.ruby-lang.org/en/news/2021/05/02/os-command-injection-in-rdoc/"
          }
        ],
        "sourceIdentifier": "cve@mitre.org",
        "vulnStatus": "Modified",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-78"
              }
            ],
            "source": "nvd@nist.gov",
            "type": "Primary"
          }
        ]
      }
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...

Loading...
  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.