cve.bz

CVE-2021-31799 OS Command Injection

7.0 highEPSS 1.5%Fix available

High (7.0). EPSS 1.5% estimated probability of exploitation activity in the next 30 days. Fixed in rdoc 6.1.2.1, 6.2.1.1, 6.3.1.

On this page
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.

Severity

CVSS 3.1

7.0 high
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
1.5% (unchanged from 1.5% a week ago; 1.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 75th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2024-10-15. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-78 Improper Neutralization of Special Elements used in an OS Command (OS Command Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-31799 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-31799?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-31799?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-31799 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
debian:debian_linux9.0
debian:debian_linux10.0
ruby-lang:rdocfrom 3.11 before 6.3.1
oracle:jd_edwards_enterpriseone_toolsbefore 9.2.6.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-ggxm-pgc9-g7fpRubyGemsrdoc>=3.11 <6.1.2.16.1.2.1
GHSA-ggxm-pgc9-g7fpRubyGemsrdoc>=6.2.0 <6.2.1.16.2.1.1
GHSA-ggxm-pgc9-g7fpRubyGemsrdoc>=6.3.0 <6.3.16.3.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9ruby2.32.3.3-1+deb9u10DLA-2780-1
Debian10ruby2.52.5.5-3+deb10u4DSA-5066-1
Debian11ruby2.72.7.4-1DEBIAN-CVE-2021-31799
Ubuntu18.04:LTSruby2.52.5.1-1ubuntu1.10UBUNTU-CVE-2021-31799 USN-5020-1
Ubuntu20.04:LTSruby2.72.7.0-5ubuntu1.5UBUNTU-CVE-2021-31799 USN-5020-1
UbuntuPro:16.04:LTSruby2.32.3.1-2~ubuntu16.04.16+esm1UBUNTU-CVE-2021-31799 USN-5020-1
Red Hatenterprise_linux:8::appstreamruby, ruby-doc, ruby-irb and 5 more0:2.5.9-109.module+el8.5.0+14275+d9c243caRHSA-2022:0672
Red Hatenterprise_linux:8::appstreamruby, ruby-doc, ruby-libs and 5 more0:2.7.4-137.module+el8.4.0+12025+f744ca41RHSA-2021:3020
Red Hatenterprise_linux:8::appstreamruby, ruby-doc, ruby-libs and 4 more0:2.6.9-108.module+el8.5.0+13719+08a8ba32RHSA-2022:0543
Red Hatenterprise_linux:8::appstreamrubygem-abrt, rubygem-abrt-doc0:0.3.0-4.module+el8.1.0+3653+beb38eb0RHSA-2022:0543
Red Hatenterprise_linux:8::appstreamrubygem-abrt, rubygem-abrt-doc0:0.3.0-4.module+el8.1.0+3656+f80bfa1dRHSA-2022:0672
Red Hatenterprise_linux:8::appstreamrubygem-abrt, rubygem-abrt-doc0:0.4.0-1.module+el8.3.0+7192+4e3a532aRHSA-2021:3020
Red Hatenterprise_linux:8::appstreamrubygem-bigdecimal, rubygem-bigdecimal-debuginfo0:1.3.4-109.module+el8.5.0+14275+d9c243caRHSA-2022:0672
Red Hatenterprise_linux:8::appstreamrubygem-bigdecimal, rubygem-bigdecimal-debuginfo0:1.4.1-108.module+el8.5.0+13719+08a8ba32RHSA-2022:0543
Red Hatenterprise_linux:8::appstreamrubygem-bigdecimal, rubygem-bigdecimal-debuginfo0:2.0.0-137.module+el8.4.0+12025+f744ca41RHSA-2021:3020
Red Hatenterprise_linux:8::appstreamrubygem-bson, rubygem-bson-doc, rubygem-bson-debuginfo and 1 more0:4.3.0-2.module+el8.1.0+3656+f80bfa1dRHSA-2022:0672
Red Hatenterprise_linux:8::appstreamrubygem-bson, rubygem-bson-doc, rubygem-bson-debuginfo and 1 more0:4.5.0-1.module+el8.1.0+3653+beb38eb0RHSA-2022:0543
Red Hatenterprise_linux:8::appstreamrubygem-bson, rubygem-bson-doc, rubygem-bson-debuginfo and 1 more0:4.8.1-1.module+el8.3.0+7192+4e3a532aRHSA-2021:3020
169 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 6, Enterprise Storage 7, Linux Enterprise High Performance Computing 15 SP1-ESPOS and 19 moreruby2.52.5.9-150000.4.23.1SUSE-SU-2022:1512-1
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 10 moreruby2.52.5.9-4.20.1SUSE-SU-2021:3838-1
SUSEHPE Helion OpenStack 8, Linux Enterprise Server 12 SP2-BCL, Linux Enterprise Server 12 SP3-BCL and 11 moreruby2.12.1.9-19.6.1SUSE-SU-2021:3837-1
openSUSELeap 15.2ruby2.52.5.9-lp152.2.9.1openSUSE-SU-2021:1535-1
openSUSELeap 15.3ruby2.52.5.9-4.20.1openSUSE-SU-2021:3838-1
openSUSELeap 15.3, Leap 15.4ruby2.52.5.9-150000.4.23.1SUSE-SU-2022:1512-1
openSUSETumbleweedruby2.72.7.4-1.1openSUSE-SU-2024:11622-1
openSUSETumbleweedruby3.03.0.2-1.1openSUSE-SU-2024:11623-1
openSUSETumbleweedruby3.13.1.0-1.1openSUSE-SU-2024:11786-1
openSUSETumbleweedruby3.23.2.1-1.1openSUSE-SU-2024:12712-1
openSUSETumbleweedruby3.33.3.0-1.2openSUSE-SU-2024:13623-1
openSUSETumbleweedruby3.43.4.1-1.1openSUSE-SU-2025:14621-1
openSUSETumbleweedruby4.04.0.0~preview2-1.1openSUSE-SU-2025:15819-1
AlmaLinux8ruby, ruby-doc, ruby-irb and 2 more2.5.9-109.module_el8.5.0+259+8cec6917ALSA-2022:0672
AlmaLinux8ruby, ruby-doc, ruby-irb and 2 more2.5.9-109.module_el8.5.0+2627+d9c243caALSA-2022:0672
AlmaLinux8ruby, ruby-doc, ruby-libs and 1 more2.6.9-108.module_el8.5.0+250+ba22dbf7ALSA-2022:0543
AlmaLinux8ruby, ruby-doc, ruby-libs and 1 more2.6.9-108.module_el8.5.0+2623+08a8ba32ALSA-2022:0543
AlmaLinux8ruby, ruby-doc, ruby-libs and 2 more2.7.4-137.module_el8.4.0+2515+f744ca41ALSA-2021:3020
AlmaLinux8ruby, ruby-libs, ruby-devel2.7.4-137.module_el8.5.0+117+35d1289bALSA-2021:3020
AlmaLinux8rubygem-abrt, rubygem-abrt-doc0.3.0-4.module_el8.5.0+259+8cec6917ALSA-2022:0543
AlmaLinux8rubygem-abrt, rubygem-abrt-doc0.3.0-4.module_el8.5.0+2623+08a8ba32ALSA-2022:0543 ALSA-2022:0672
AlmaLinux8rubygem-abrt, rubygem-abrt-doc0.3.0-4.module_el8.5.0+2625+ec418553ALSA-2022:0672
AlmaLinux8rubygem-abrt, rubygem-abrt-doc0.4.0-1.module_el8.3.0+6147+d0dfc1e4ALSA-2021:3020
AlmaLinux8rubygem-abrt, rubygem-abrt-doc0.4.0-1.module_el8.4.0+2399+4e3a532aALSA-2021:3020
AlmaLinux8rubygem-abrt, rubygem-abrt-doc0.4.0-1.module_el8.5.0+118+1ab773e1ALSA-2021:3020
88 more for AlmaLinux in the JSON.

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8ruby:2.7-8040020210728141159.522a0ee4Fixed 2021-08-05RHSA-2021:3020
Red Hat Enterprise Linux 8ruby:2.6-8050020211215144356.c5368500Fixed 2022-02-16RHSA-2022:0543
Red Hat Enterprise Linux 8ruby:2.5-8050020220216195847.c5368500Fixed 2022-02-24RHSA-2022:0672
Red Hat Enterprise Linux 8.1 Update Services for SAP Solutionsruby:2.6-8010020220201152941.c27ad7f8Fixed 2022-02-21RHSA-2022:0581
Red Hat Enterprise Linux 8.2 Extended Update Supportruby:2.6-8020020220201131207.4cda2c84Fixed 2022-02-21RHSA-2022:0582
Red Hat Enterprise Linux 8.4 Extended Update Supportruby:2.6-8040020220131135901.522a0ee4Fixed 2022-02-16RHSA-2022:0544
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-ruby27-ruby-0:2.7.4-130.el7Fixed 2021-09-20RHSA-2021:3559
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-ruby30-ruby-0:3.0.2-148.el7Fixed 2021-10-25RHSA-2021:3982
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-ruby26-ruby-0:2.6.9-120.el7Fixed 2022-02-28RHSA-2022:0708
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUSrh-ruby27-ruby-0:2.7.4-130.el7Fixed 2021-09-20RHSA-2021:3559
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUSrh-ruby30-ruby-0:3.0.2-148.el7Fixed 2021-10-25RHSA-2021:3982
Red Hat 3scale API Management Platform 2systemFix deferred
Red Hat Enterprise Linux 6rubyNot affected
Red Hat Enterprise Linux 7rubyOut of support scope
Red Hat Enterprise Linux 9rubyNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-31799.

Attack patterns (CAPEC)

  • CAPEC-6 Argument Injection Likelihood: High · Severity: High
  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-88 OS Command Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON