CVE-2021-31799 Arbitrary Code Execution in Rdoc

High 7.0 Published Updated

Attackers can execute arbitrary code via malicious filenames in RDoc, affecting Ruby users who process untrusted documentation files.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2021-31799?

CVE-2021-31799 is a high-severity command injection vulnerability in Debian Debian Linux, published on 29 Jul 2021. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-78

Which versions are affected by CVE-2021-31799?

6 open source packages ship an affected version, including rdoc. It affects 3 products.

PackageAffectedFixed in
rdoc RubyGemsFrom 3.116.1.2.1
rdoc RubyGemsFrom 3.116.1.2.1
rdoc RubyGemsFrom 6.2.06.2.1.1
rdoc RubyGemsFrom 6.2.06.2.1.1
rdoc RubyGemsFrom 6.3.06.3.1
rdoc RubyGemsFrom 6.3.06.3.1

Products include Debian Debian Linux, Oracle Jd Edwards Enterpriseone Tools, Ruby-Lang Rdoc.

How do I fix CVE-2021-31799?

Upgrade rdoc to a fixed version for your release line: 6.1.2.1, 6.2.1.1 or 6.3.1.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2021-31799 being exploited?

There is no known exploitation of CVE-2021-31799 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2021-31799, CLEANSTART-2026-ZN97904, DEBIAN-CVE-2021-31799, GHSA-ggxm-pgc9-g7fp, UBUNTU-CVE-2021-31799.

Is CVE-2021-31799 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free