what you don't know can hurt you

NiceHash Miner Excavator 1.6.7c Cross Site Request Forgery

NiceHash Miner Excavator 1.6.7c Cross Site Request Forgery
Posted May 18, 2021
Authored by Harry Sintonen

NiceHash Miner Excavator versions 1.6.7c and below suffer from a cross site request forgery vulnerability. The issue enables any external web site to send commands to the local miner instance, and to redirect the mined coins to an arbitrary mining address.

tags | exploit, web, arbitrary, local, csrf
SHA-256 | fb87f0499aef3335445d3f11dca696cc51f521e079a6ba1f2728e565105afbc1

NiceHash Miner Excavator 1.6.7c Cross Site Request Forgery

Change Mirror Download
NiceHash Miner Excavator API Cross-Site Request Forgery
=======================================================
The latest version of this advisory is available at:
https://sintonen.fi/advisories/nicehash-miner-excavator-api-csrf.txt


Overview
--------

NiceHash Miner Excavator plugin contains a vulnerability that enables any external
web site to send commands to the local miner instance, and to redirect the mined
coins to arbitrary mining address.


Description
-----------

NiceHash Miner Excavator plugin uses a local JSON API at localhost:4000. External
javascript (any website browsed by the victim) can craft and send JSON requests to
the API endpoint by employing XMLHTTPRequest objects.


Impact
------

Malicious website can command the NiceHash Excavator miner to send the coins to
an arbitrary mining address, effectively stealing the mined coins.


Details
-------

The discovered vulnerability, described in more detail below, enables the attack
described here in brief.

1. The attacker creates a JavaScript payload that uses XMLHTTPRequest object to
send JSON API commands to localhost:4000 API endpoint. Note that the API
expects a raw TCP connection but since the parser is relaxed, it will skip any
non-JSON input such as the GET line and the HTTP header lines until the actual
HTTP POST data is met. Additionally since there is no need to specify a
Content-Type for the request, no Cross-Origin Resource Sharing preflight check
is needed or performed. The payload uses the 'subscribe' API method to connect
the miner to the attacker's mining address. The payload then uses
'cmdfile.commit' method to make the address change persistent.

2. The victim running the NiceHash Miner Excavator plugin browses to the site
hosting the malicious JavaScript payload. The payload activates and redirects
NiceHash Miner to send the mined coins to the attacker's mining address.

3. By targetting a wide audience of users running NiceHash Excavator Miner, the
attacker could acquire thousands of miners, resulting in huge profits.


Vulnerabilities
---------------

1. CWE-20: Improper Input Validation

The root cause for the vulnerability is the lax input validation of the Excavator
TCP API endpoint. The API will consume newline terminated lines arriving to the
API endpoint and merely skip invalid lines. This enables the attack to work via
regular HTTP requests, effectively enabling the Cross-Site Request Forgery attack.


Vulnerable versions
-------------------

The following product versions are vulnerable:

- NiceHash Excavator plugin up to and including version 1.6.7c.


End user recommendations
------------------------

1. Upgrade to the NiceHash Miner 3.0.6.5 or later.


Credits
-------

The vulnerability was discovered by Harry Sintonen / F-Secure Consulting.


Timeline
--------

2021.03.28 discovered the vulnerability
2021.03.28 wrote a proof of concept exploit
2021.03.28 contacted NiceHash over security@nicehash.com
2021.03.28 wrote the first draft of this advisory
2021.03.28 sent the advisory to security@nicehash.com
2021.03.29 Excavator plugin 1.6.11a released. this version switched to
HTTP JSON API (-wp 4000)
2021.04.02 reminded security@nicehash.com that -wp 4000 alone doesn't resolve
the issue
2021.04.15 NiceHash Miner 3.0.6.5 released, fixing the vulnerability
2021.05.14 public disclosure


Login or Register to add favorites

File Archive:

May 2022

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    0 Files
  • 2
    May 2nd
    15 Files
  • 3
    May 3rd
    19 Files
  • 4
    May 4th
    24 Files
  • 5
    May 5th
    15 Files
  • 6
    May 6th
    14 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    13 Files
  • 10
    May 10th
    7 Files
  • 11
    May 11th
    99 Files
  • 12
    May 12th
    45 Files
  • 13
    May 13th
    7 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    26 Files
  • 18
    May 18th
    4 Files
  • 19
    May 19th
    17 Files
  • 20
    May 20th
    2 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    6 Files
  • 24
    May 24th
    19 Files
  • 25
    May 25th
    5 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close