CVE-2021-31799 Arbitrary Code Execution in Rdoc
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.
| Package | Affected | Fixed in |
|---|---|---|
rdoc RubyGems | From 3.11 | 6.1.2.1 |
rdoc RubyGems | From 3.11 | 6.1.2.1 |
rdoc RubyGems | From 6.2.0 | 6.2.1.1 |
rdoc RubyGems | From 6.2.0 | 6.2.1.1 |
rdoc RubyGems | From 6.3.0 | 6.3.1 |
rdoc RubyGems | From 6.3.0 | 6.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.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as ALPINE-CVE-2021-31799, CLEANSTART-2026-ZN97904, DEBIAN-CVE-2021-31799, GHSA-ggxm-pgc9-g7fp, UBUNTU-CVE-2021-31799.