Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
💎
💎 RubyGems
Not in CISA KEV
HIGH severity

CVE-2021-31799 — rdoc

HIGHFix: ruby/rdoc@a7f5d6a

CVE-2021-31799 is a high-severity (CVSS 7) OS Command Injection vulnerability in rdoc. A fix is available for rdoc — see the affected versions and patch details below.

Arbitrary Code Execution in Rdoc

Also known asGHSA-ggxm-pgc9-g7fp
Published
Updated
Affected
3 pkgs
Patched
3 / 3
Exploits
None indexed
Exploitation data as of Oct 6, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • A successful exploit gives an attacker total control of the affected component, not partial access.
  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2021-31799.

EPSS Exploitation Probability

via FIRST.org ↗
1.5%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs73th percentile — riskier than 73% of all scored CVEsHighest risk
0.00%0.66%1.32%1.98%0.4%1.5%1.5%1.5%May 26Sep 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2021-31799 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,386 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

3 pkgs affected
💎rdoc💎rdoc💎rdoc

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.

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.

Affected Packages

3 total 3 fixed
EcosystemPackageVulnerable rangeFix
💎RubyGemsrdoc≥ 3.11&&< 6.1.2.16.1.2.1bundle update rdoc --conservative
💎RubyGemsrdoc≥ 6.2.0&&< 6.2.1.16.2.1.1bundle update rdoc --conservative
💎RubyGemsrdoc≥ 6.3.0&&< 6.3.16.3.1bundle update rdoc --conservative

Affected Products

3 products · 4 configurations
OS
debian linuxdebian
2 versions
9.010.0
Application
jd edwards enterpriseone toolsoracle
< 9.2.6.1
range
Application
rdocruby-lang
≥ 3.11 && < 6.3.1
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for rdoc, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update rdoc to 6.1.2.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-31799 is resolved across your whole dependency graph.

  3. Workarounds

    Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate
ProductFixed inAdvisory
Red Hat Enterprise Linux 8ruby:2.7-8040020210728141159.522a0ee4RHSA-2021:3020
Red Hat Enterprise Linux 8ruby:2.6-8050020211215144356.c5368500RHSA-2022:0543
Red Hat Enterprise Linux 8ruby:2.5-8050020220216195847.c5368500RHSA-2022:0672
Red Hat Enterprise Linux 8.1 Update Services for SAP Solutionsruby:2.6-8010020220201152941.c27ad7f8RHSA-2022:0581
Red Hat Enterprise Linux 8.2 Extended Update Supportruby:2.6-8020020220201131207.4cda2c84RHSA-2022:0582
Red Hat Enterprise Linux 8.4 Extended Update Supportruby:2.6-8040020220131135901.522a0ee4RHSA-2022:0544
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-ruby27-ruby-0:2.7.4-130.el7RHSA-2021:3559
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-ruby30-ruby-0:3.0.2-148.el7RHSA-2021:3982

Frequently Asked Questions

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.
O3 Security · Impact-Aware SCA

Is CVE-2021-31799 in your dependencies?

Find it across RubyGems, including transitive dependencies.

CVE-2021-31799: rdoc RCE — Fixed in 6.1.2.1