CVE-2021-31810 json
An issue was discovered in Ruby through 2.6.7, 2.7.x through 2.7.3, and 3.x through 3.0.1.
published 5y ago modified 2mo ago also BIT-ruby-2021-31810 , BIT-ruby-min-2021-31810 , EUVD-2021-18688 , JLSEC-2026-1284
- cvss
- 5.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 3.1%
- EPSS 3.1% chance of exploitation in 30 days, percentile 87%
- public exploits
- 0
- none known
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).
Patch / fix
- bitnami ruby 2.6.8, 2.7.4, 3.0.2
- bitnami ruby-min 2.6.8, 2.7.4, 3.0.2
- oracle jd_edwards_enterpriseone_tools 9.2.6.1
- jruby Debian 14, Debian 13, Debian 12 9.3.9.0+ds-1
debian advisories DEBIAN-CVE-2021-31810
- ruby2.5 Ubuntu 18.04 LTS 2.5.1-1ubuntu1.10
- ruby2.7 Ubuntu 20.04 LTS 2.7.0-5ubuntu1.5
- ruby2.3 Ubuntu Pro 16.04 LTS 2.3.1-2~ubuntu16.04.16+esm1
ubuntu advisories UBUNTU-CVE-2021-31810
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- ruby4.0 hummingbird 1 4.0.0-33.3.hum1
- ruby4.0-libs hummingbird 1 4.0.0-33.3.hum1
- ruby4.0-bundled-gems hummingbird 1 4.0.0-33.3.hum1
- ruby4.0-default-gems hummingbird 1 4.0.0-33.3.hum1
- ruby3.3 hummingbird 1 3.3.10-23.1.hum1
- ruby3.3-libs hummingbird 1 3.3.10-23.1.hum1
- ruby3.3-bundled-gems hummingbird 1 3.3.10-23.1.hum1
- ruby3.3-default-gems hummingbird 1 3.3.10-23.1.hum1
red hat advisories RHSA-2026:8838RHSA-2026:7305RHSA-2026:7307RHSA-2022:0582RHSA-2022:0581RHSA-2022:0708
- ruby WebYast 1.3 1.8.7.p357-0.9.20.3.1
- ruby2.5 SLES for SAP 15 SP2, SLES for SAP 15 SP1, SLES for SAP 15 +21 more 2.5.9-150000.4.23.1
- ruby2.5 SLES for SAP 15 SP1, SLES for SAP 15, SLES 15-LTSS +10 more 2.5.9-4.20.1
- ruby2.1 SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES for SAP 12 SP3 +11 more 2.1.9-19.6.1
suse advisories SUSE-SU-2022:15034-1SUSE-SU-2022:1512-1SUSE-SU-2021:3838-1SUSE-SU-2021:3837-1
- ruby4.0 openSUSE Tumbleweed 4.0.0~preview2-1.1
- ruby3.4 openSUSE Tumbleweed 3.4.1-1.1
- ruby2.7 openSUSE Tumbleweed 2.7.4-1.1
- ruby3.0 openSUSE Tumbleweed 3.0.2-1.1
- ruby3.1 openSUSE Tumbleweed 3.1.0-1.1
- ruby3.2 openSUSE Tumbleweed 3.2.1-1.1
- ruby3.3 openSUSE Tumbleweed 3.3.0-1.2
- ruby2.5 openSUSE Leap 15.2 2.5.9-lp152.2.9.1
opensuse advisories openSUSE-SU-2025:15819-1openSUSE-SU-2025:14621-1openSUSE-SU-2024:11622-1openSUSE-SU-2024:11623-1openSUSE-SU-2024:11786-1openSUSE-SU-2024:12712-1
- ruby AlmaLinux 8 2.5.9-109.module_el8.5.0+2627+d9c243ca
- ruby AlmaLinux 8 2.5.9-109.module_el8.5.0+259+8cec6917
- ruby-irb AlmaLinux 8 2.5.9-109.module_el8.5.0+259+8cec6917
- ruby-irb AlmaLinux 8 2.5.9-109.module_el8.5.0+2627+d9c243ca
- rubygems AlmaLinux 8 2.7.6.3-109.module_el8.5.0+2627+d9c243ca
- rubygems AlmaLinux 8 2.7.6.3-109.module_el8.5.0+259+8cec6917
- ruby-libs AlmaLinux 8 2.5.9-109.module_el8.5.0+2627+d9c243ca
- ruby-libs AlmaLinux 8 2.5.9-109.module_el8.5.0+259+8cec6917
almalinux advisories ALSA-2022:0672ALSA-2022:0543ALSA-2021:3020
- ruby Rocky Linux 8 2.5.9-109.module+el8.5.0+740+b85cbe0d
- rubygem-pg Rocky Linux 8 1.0.0-2.module+el8.4.0+592+03ff458a
- rubygem-pg Rocky Linux 8 1.0.0-2.module+el8.3.0+167+5c390590
- rubygem-abrt Rocky Linux 8 0.3.0-4.module+el8.5.0+738+032c9c02
- rubygem-abrt Rocky Linux 8 0.3.0-4.module+el8.3.0+167+5c390590
- rubygem-abrt Rocky Linux 8 0.3.0-4.module+el8.4.0+592+03ff458a
- rubygem-bson Rocky Linux 8 4.3.0-2.module+el8.4.0+592+03ff458a
- rubygem-bson Rocky Linux 8 4.3.0-2.module+el8.3.0+167+5c390590
rocky linux advisories RLSA-2022:0672RLSA-2022:0543RLSA-2021:3020
- ruby Alpine 3.11 2.6.8-r0
- ruby Alpine 3.24, Alpine 3.23, Alpine 3.22 +10 more 2.7.4-r0
alpine advisories ALPINE-CVE-2021-31810
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- hackerone.com/reports/1145454 advisory
- oracle.com/security-alerts/cpuapr2022.html advisory
Is CVE-2021-31810 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-31810 updated cvss 5.4
ruby: FTP PASV command response can cause Net::FTP to connect to arbitrary host
-
Red Hat Enterprise Linux 6 ruby, ruby-ri, ruby-irb, ruby-libs, ruby-rdoc, ruby-tcltk Red Hat Enterprise Linux 7 ruby, ruby-irb, rubygems, ruby-libs, ruby-tcltk, rubygem-json, +6 moreaffected: no fix planned “Out of support scope”
-
Red Hat Hardened Images rubyaffected: no fix available
-
Red Hat Enterprise Linux AppStream (v. 8) ruby 2.5.9-109.module+el8.5.0+14275+d9c243ca, ruby 2.6.9-108.module+el8.5.0+13719+08a8ba32, ruby 2.7.4-137.module+el8.4.0+12025+f744ca41, rubygem-pg 1.0.0-2.module+el8.1.0+3656+f80bfa1d, rubygem-pg 1.1.4-1.module+el8.1.0+3653+beb38eb0, rubygem-pg 1.2.3-1.module+el8.3.0+7192+4e3a532a, +63 morefixed: vendor fix RHSA-2021:3020
-
Red Hat Enterprise Linux AppStream E4S (v. 8.1) ruby 2.6.9-107.module+el8.1.0+14088+04cf326e, rubygem-pg 1.1.4-1.module+el8.1.0+3653+beb38eb0, ruby-libs 2.6.9-107.module+el8.1.0+14088+04cf326e, rubygem-abrt 0.3.0-4.module+el8.1.0+3653+beb38eb0, rubygem-bson 4.5.0-1.module+el8.1.0+3653+beb38eb0, rubygem-mongo 2.8.0-1.module+el8.1.0+3653+beb38eb0, +17 morefixed: vendor fix RHSA-2022:0581
-
Red Hat Enterprise Linux AppStream EUS (v. 8.2) ruby 2.6.9-107.module+el8.2.0+14086+86d863af, rubygem-pg 1.1.4-1.module+el8.1.0+3653+beb38eb0, ruby-libs 2.6.9-107.module+el8.2.0+14086+86d863af, rubygem-abrt 0.3.0-4.module+el8.1.0+3653+beb38eb0, rubygem-bson 4.5.0-1.module+el8.1.0+3653+beb38eb0, rubygem-mongo 2.8.0-1.module+el8.1.0+3653+beb38eb0, +17 morefixed: vendor fix RHSA-2022:0582
-
Red Hat Enterprise Linux AppStream EUS (v.8.4) ruby 2.6.9-108.module+el8.4.0+14070+b3717926, rubygem-pg 1.1.4-1.module+el8.1.0+3653+beb38eb0, ruby-libs 2.6.9-108.module+el8.4.0+14070+b3717926, rubygem-abrt 0.3.0-4.module+el8.1.0+3653+beb38eb0, rubygem-bson 4.5.0-1.module+el8.1.0+3653+beb38eb0, rubygem-mongo 2.8.0-1.module+el8.1.0+3653+beb38eb0, +17 morefixed: vendor fix RHSA-2022:0544
-
Red Hat Hardened Images ruby3.4 3.4.8-31.1.hum1, ruby4.0 4.0.0-33.3.hum1, ruby3.3 3.3.10-23.1.hum1, ruby3.4-libs 3.4.8-31.1.hum1, ruby4.0-libs 4.0.0-33.3.hum1, ruby3.3-libs 3.3.10-23.1.hum1, +6 morefixed: vendor fix RHSA-2026:7305
-
Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-ruby27-ruby 2.7.4-130.el7, rh-ruby30-ruby 3.0.2-148.el7, rh-ruby27-rubygems 3.1.6-130.el7, rh-ruby27-ruby-libs 2.7.4-130.el7, rh-ruby30-ruby-libs 3.0.2-148.el7, rh-ruby30-rubygems 3.2.22-148.el7, +31 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) rh-ruby27-ruby 2.7.4-130.el7, rh-ruby30-ruby 3.0.2-148.el7, rh-ruby27-rubygems 3.1.6-130.el7, rh-ruby27-ruby-libs 2.7.4-130.el7, rh-ruby30-ruby-libs 3.0.2-148.el7, rh-ruby30-rubygems 3.2.22-148.el7, +31 more Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-ruby27-ruby 2.7.4-130.el7, rh-ruby30-ruby 3.0.2-148.el7, rh-ruby27-rubygems 3.1.6-130.el7, rh-ruby27-ruby-libs 2.7.4-130.el7, rh-ruby30-ruby-libs 3.0.2-148.el7, rh-ruby30-rubygems 3.2.22-148.el7, +31 morefixed: vendor fix RHSA-2021:3559
show 2 moreshow fewer
-
Red Hat Software Collections for RHEL Workstation(v. 7) rh-ruby26-ruby 2.6.9-120.el7, rh-ruby26-ruby-libs 2.6.9-120.el7, rh-ruby26-rubygems 3.0.3.1-120.el7, rh-ruby26-rubygem-irb 1.0.0-120.el7, rh-ruby26-rubygem-json 2.1.0-120.el7, rh-ruby26-rubygem-psych 3.1.0-120.el7, +12 more Red Hat Software Collections for RHEL(v. 7) rh-ruby26-ruby 2.6.9-120.el7, rh-ruby26-ruby-libs 2.6.9-120.el7, rh-ruby26-rubygems 3.0.3.1-120.el7, rh-ruby26-rubygem-irb 1.0.0-120.el7, rh-ruby26-rubygem-json 2.1.0-120.el7, rh-ruby26-rubygem-psych 3.1.0-120.el7, +12 morefixed: vendor fix RHSA-2022:0708
-
Red Hat Enterprise Linux 9 ruby, rubygems, ruby-libs, rubygem-irb, rubygem-rbs, rubygem-rss, +13 more Red Hat Hardened Images rubygem3.3-rbs 3.4.0-23.1.hum1, rubygem3.3-rss 0.3.1-23.1.hum1, rubygem3.4-rbs 3.8.0-31.1.hum1, rubygem3.4-rss 0.3.1-31.1.hum1, rubygem4.0-rss 0.3.2-33.3.hum1, rubygem3.3-irb 1.13.1-23.1.hum1, +45 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
3.05% chance of exploitation in the next 30 days, higher than 87% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- hackerone.com https://hackerone.com/reports/1145454 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
| OSV | 3.1 | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| bitnami | ruby | <2.6.8 >=2.7.0, <2.7.4 >=3.0.0, <3.0.2 |
2.6.8 2.7.4 3.0.2 |
| bitnami | ruby-min | <2.6.8 >=2.7.0, <2.7.4 >=3.0.0, <3.0.2 |
2.6.8 2.7.4 3.0.2 |
| julia | ruby_jll | all versions |
no fix listed |
References
-
hackerone.com
/reports/1145454
exploit, patch, third-party-advisory, advisory, web
-
oracle.com
/security-alerts/cpuapr2022.html
patch, third-party-advisory, advisory, web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/MWXHK5UUHVSHF7HTHMX6JY3WXDVNIHSL/
vendor-advisory, web
-
security.gentoo.org
/glsa/202401-27
vendor-advisory, web
-
ruby-lang.org
/en/news/2021/07/07/trusting-pasv-responses-in-net-ftp/
vendor-advisory, advisory, web
-
lists.debian.org
/debian-lts-announce/2021/10/msg00009.html
mailing-list, third-party-advisory, advisory, web
-
security.netapp.com
/advisory/ntap-20210917-0001/
third-party-advisory, advisory, web
-
lists.debian.org
/debian-lts-announce/2023/04/msg00033.html
mailing-list, web
-
nvd.nist.gov
/vuln/detail/CVE-2021-31810
web
Sources
- CVE List CVE-2021-31810
- NVD CVE-2021-31810
- OSV BIT-ruby-2021-31810
- OSV BIT-ruby-min-2021-31810
- OSV JLSEC-2026-1284
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.