Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2021-31810
Ruby vulnerability analysis and mitigation

Overview

A vulnerability was discovered in Ruby through versions 2.6.7, 2.7.x through 2.7.3, and 3.x through 3.0.1. The vulnerability (CVE-2021-31810) allows a malicious FTP server to use the PASV response to trick Net::FTP into connecting back to a given IP address and port (Ruby News, NVD).

Technical details

The vulnerability exists in the Net::FTP module's handling of PASV responses. When a malicious FTP server sends a crafted PASV response, it can manipulate the Net::FTP client into establishing connections to arbitrary IP addresses and ports. The vulnerability has been assigned a CVSS v3.1 base score of 5.8 (Medium) with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N (NVD).

Impact

The successful exploitation of this vulnerability could allow attackers to conduct port scans and extract service banner information from otherwise private and undisclosed services. This potentially enables attackers to gather information about internal network services that should not be accessible externally (Ruby News).

Exploitability

The vulnerability can be exploited remotely by a malicious FTP server without requiring any user interaction or special privileges. The attack complexity is considered low, as it only requires the ability to control an FTP server and send crafted PASV responses (NVD).

Mitigation and workarounds

The vulnerability has been fixed in newer versions of Ruby. Users are strongly recommended to upgrade to patched versions. For Ruby 2.6 series: versions after 2.6.7, Ruby 2.7 series: versions after 2.7.3, and Ruby 3.0 series: versions after 3.0.1. Note that while net-ftp is a default gem in Ruby 3.0.1, it has a packaging issue, so users should upgrade Ruby itself rather than just the gem (Ruby News).

Community reactions

Multiple organizations and vendors have acknowledged this vulnerability and released security advisories, including NetApp, Oracle, and various Linux distributions. The vulnerability has been included in security updates for numerous enterprise systems and applications (NetApp Advisory, Oracle Alert).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Alpine

Fixed

edge

ruby: 2.7.4-r0

Fixed

v3.18

ruby: 2.7.4-r0

Fixed

v3.19

ruby: 2.7.4-r0

Fixed

v3.20

ruby: 2.7.4-r0

Fixed

v3.21

ruby: 2.7.4-r0

Fixed

v3.22

ruby: 2.7.4-r0

Fixed

v3.23

ruby: 2.7.4-r0

Fixed

Arch Linux

Fixed

rolling

ruby: 3.0.2-1

Fixed

SourceThis report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-50276HIGH7.5
  • Ruby logoRuby
  • datadog
NoYesSep 14, 2026
CVE-2026-70658HIGH7.4
  • Ruby logoRuby
  • pay
NoNoSep 14, 2026
CVE-2026-44163MEDIUM5.3
  • Ruby logoRuby
  • fluent-plugin-opentelemetry
NoYesSep 15, 2026
CVE-2026-44282MEDIUM4.8
  • Ruby logoRuby
  • decidim-elections
NoYesSep 15, 2026
CVE-2026-44162LOW2.7
  • Ruby logoRuby
  • fluent-plugin-s3
NoYesSep 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management