Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-31810

An issue was discovered in Ruby through 2.6.7, 2.7.x through 2.7.3, and 3.x through 3.0.1. A malicious FTP server can use the PASV response to trick Net::FTP into connecting back to a given IP address and port. This potentially makes curl extract information about services that are otherwise private and not disclosed (e.g., the attacker can conduct port scans and service banner extractions).

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-31810
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 05:08 UTC · Revision 1

Source evidence

CVE-2021-31810

core-osv · Original source

Published 13 Jul 2021, 13:15 UTC

An issue was discovered in Ruby through 2.6.7, 2.7.x through 2.7.3, and 3.x through 3.0.1. A malicious FTP server can use the PASV response to trick Net::FTP into connecting back to a given IP address and port. This potentially makes curl extract information about services that are otherwise private and not disclosed (e.g., the attacker can conduct port scans and service banner extractions).

osv:CVE-2021-31810
Complete source record
{
  "id": "5d4a2f76c8564f0b9c1419093ade5e742c18575f7990c609926801efbdeeb3d8",
  "url": "https://osv.dev/vulnerability/CVE-2021-31810",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-31810",
    "summary": "An issue was discovered in Ruby through 2.6.7, 2.7.x through 2.7.3, and 3.x through 3.0.1. A malicious FTP server can use the PASV response to trick Net::FTP into connecting back to a given IP address and port. This potentially makes curl extract information about services that are otherwise private and not disclosed (e.g., the attacker can conduct port scans and service banner extractions).",
    "evidence": "osv:CVE-2021-31810",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-31810",
      "aliases": [
        "BIT-ruby-2021-31810",
        "BIT-ruby-min-2021-31810",
        "CVE-2021-31810"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/ruby/ruby",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "930143880a8b593e7444b94e2e0522b83a25c671"
                },
                {
                  "introduced": "647ee6f091eafcce70ffb75ddf7e121e192ab217"
                },
                {
                  "last_affected": "6847ee089d7655b2a0eea4fee3133aeacd4cc7cc"
                },
                {
                  "introduced": "95aff214687a5e12c3eb57d056665741e734c188"
                },
                {
                  "last_affected": "0fb782ee38ea37fd5fe8b1f775f8ad866a82a3f0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "2.6.7"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.7.0"
                      },
                      {
                        "last_affected": "2.7.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.0.0"
                      },
                      {
                        "last_affected": "3.0.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3_0_1",
            "v2_7_3",
            "v2_6_7",
            "v3_0_0",
            "v2_7_2",
            "v2_7_1",
            "v2_7_0",
            "v1_0_r2"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-31810.json"
          }
        }
      ],
      "modified": "2026-10-24T10:30:24.974872008Z",
      "provider": "osv",
      "references": [
        "https://lists.debian.org/debian-lts-announce/2023/04/msg00033.html",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MWXHK5UUHVSHF7HTHMX6JY3WXDVNIHSL/",
        "https://lists.debian.org/debian-lts-announce/2021/10/msg00009.html",
        "https://security.gentoo.org/glsa/202401-27",
        "https://security.netapp.com/advisory/ntap-20210917-0001/",
        "https://www.ruby-lang.org/en/news/2021/07/07/trusting-pasv-responses-in-net-ftp/",
        "https://hackerone.com/reports/1145454",
        "https://www.oracle.com/security-alerts/cpuapr2022.html"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:a:oracle:jd_edwards_enterpriseone_tools:*:*:*:*:*:*:*:*"
            ],
            "vendor_product": "oracle:jd_edwards_enterpriseone_tools",
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "9.2.6.1"
                  }
                ],
                "source": "CPE_RANGE"
              }
            ]
          },
          {
            "cpes": [
              "cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"
            ],
            "vendor_product": "debian:debian_linux",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "9.0"
                  },
                  {
                    "last_affected": "9.0"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-31810",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 431266,
  "published_at": "2021-07-13T13:15:09.243+00:00"
}