Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HI-03 Insucient Timeout Handling Could Lead to Denial of Service #70

Open
xoloki opened this issue May 8, 2024 · 1 comment
Open

HI-03 Insucient Timeout Handling Could Lead to Denial of Service #70

xoloki opened this issue May 8, 2024 · 1 comment
Assignees
Labels

Comments

@xoloki
Copy link
Collaborator

xoloki commented May 8, 2024

The FIRE (meta)protocol makes provisions to remove malicious actors and to restart rounds
(or sessions) in certain instances, including for example, when time passess without
protocol state changes. However, checks are insufficient and bad actors could stall the
protocol ignoring these precautions.
For example, the process_inbound_messages() function in the FIRE coordinator seems to
be susceptible to a DOS. The function includes a first block of code where input messages
are processed, and a second block of code that processes results from the previous
codeblock results and takes care of timeouts. If for some reason the stalling were to occur in
the first block, the logic in this method could never exit and the stalling condition would
persist.
One way to exploit this consists in a signer sending a huge amount of shares/nonces for the
correct dkg_id. All of these messages will be processed and this may take more time than
what the timeout allows, yet the time check will happen much later in the code causing
fast-forwarding or failure of a DKG or signing round.

@xoloki xoloki added the audit label May 8, 2024
@xoloki xoloki self-assigned this May 8, 2024
@xoloki
Copy link
Collaborator Author

xoloki commented Dec 19, 2024

Similarly with CR-01/02 (#66 #67) sbtc-signer does not make use of the timeouts, since it has its own timeouts layered above. A number of DOS issues were discovered and fixed during the launch period, which mitigates this for other users of the library.

It is likely that in the future, we will simply remove fn process_inbound_messages entirely. It makes not only the timeouts difficult to handle properly, but also passing Err returns up the stack when processing multiple messages. sbtc-signer already bypasses it, and there were discussions about doing so in the stacks-signer dev process as well. Then we can process timeouts directly before or after any message without the long blocking queue problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant