bitcoinrb
Affected
- introduced
0, fixed1.12.0(ecosystem)
Fixed versions
1.12.0
Fix
The export has no generic command for this ecosystem.
Advisory
Also known as: None
Bitcoinrb Vulnerable to Command injection via RPC
Summary: Remote Code Execution
Unsafe handling of request parameters in the RPC HTTP server results in command injection
Details
In lib/bitcoin/rpc/http_server.rb line 30-39, the JSON body of a POST request is parsed into command and args variables. These values are then passed to send, which is used to call an arbitrary class method. However, there is no validation that the provided command value is one of the expected RPC methods.
This means that an attacker could supply a command value such as system, and then pass arbitrary system commands into the args parameter and achieve remote code execution.
PoC
curl -X POST http://127.0.0.1:18443 -H 'Content-Type: application/json' \
-d '{"method":"eval","params":["File.write(\"/tmp/pwned\",\"owned\")"]}'
Impact
This vulnerability would impact anyone running the RPC server. The impact is higher for those who are running it publicly exposed to the internet.
Remediation
Mitigating Factors:
Resolution:
RequestHandler. Low Basis: The source's own band: LOW
0, fixed 1.12.0 (ecosystem)1.12.0
The export has no generic command for this ecosystem.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0