jtgrassie / monero-pool

A Monero mining pool server written in C
BSD 3-Clause "New" or "Revised" License
353 stars 125 forks source link

Fix errors causing pool crash #98

Closed gzz2000 closed 3 years ago

gzz2000 commented 3 years ago

There are some bugs that can cause the pool to crash, thus DoS. I am very sorry to xmrvsbeast.com owners as some experiments I made on their server just make their server broken for 2 hours :(

  1. Lines 3214-3215: when provided block template but not seed_hash or next_seed_hash, the pool prints warnings but then still tries to read these values and strncpy them (presumably NULL pointers)
  2. Line 3317: even the client is not MODE_SELF_SELECT, it can still pass a miner block template using the previous RPC call, causing the nonces to write to nowhere in memory.
  3. Line 3592: did not try this but seems a similar bug as 1. warnings printed but still using it after this.
jtgrassie commented 3 years ago

Thanks.

  1. Fixed in rework 3ac432305cde853db28cce51f17de4d34f6e5505
  2. Is fixed in a7fb22f37eda32a926699ca10b44c942a879efa0
  3. Is already handled (json-c allows calling with null pointer for the source object and the returned string value is checked below).