Boost _ Shardeum_ Ancillaries 34298 - [Websites and Applications - Medium] archive-server can be kil

archive-server can be killed by connected shardus-instance

Submitted on Thu Aug 08 2024 15:15:27 GMT-0400 (Atlantic Standard Time) by @riproprip for Boost | Shardeum: Ancillaries

Report ID: #34298

Report type: Websites and Applications

Report severity: Medium

Target: https://github.com/shardeum/archive-server/tree/dev

Impacts:

  • Taking down the application/website

Description

Brief/Intro

On boot the archive-server connects to a randomized shardus-instance. This instance has the power to kill the process that runs the archive server.

Vulnerability Details

Archive-server is using an outdated socket.io-client. The old implementation has issues with specially crafted packets.

Since Archive-server does not do any special error handling the error in the socket.io-client can bubble up "uncatched" and kill the process.

Since the archive-server tries to randomly connect to a shardus-instance, it might not be a terrifying issue. Otoh I saw references in the documentation that archive servers should be rewarded for their service in the future, so there would be incentive to try to kill archive servers that you don't run ...

Proof of concept

Prepare

create and start evil shardus-instance

In one terminal

Create folder

save as package.json

save as evil-shardus.js

install packages and replace encoder with evil encoder

run evil shardus instance

run archiver

I could not find another script that made this easy. So just reusing the stuff I had for the other bugs ...

We will reuse the shardeum repo and the shardus start 10 to run an archiver. But before we run the archiver, we make sure it connects to the evil -shardus.js.

In another terminal

general setup

make sure that archiver connects to our evil implementation of a shardus-instance

run shardus

We run shardus, and observe our archive server disappear when the evil-shardus terminal prints "killing archiver". (60 second wait in current evil-shardus.js)

Last updated

Was this helpful?