Boost _ Folks Finance 34029 - [Smart Contract - Medium] Contract fails to mitigate potential critica

Submitted on Sun Aug 04 2024 10:14:52 GMT-0400 (Atlantic Standard Time) by @Obin for Boost | Folks Finance

Report ID: #34029

Report type: Smart Contract

Report severity: Medium

Target: https://testnet.snowtrace.io/address/0xa9491a1f4f058832e5742b76eE3f1F1fD7bb6837

Impacts:

  • Contract fails to mitigate a potential Critical situation where anyone will be able to call BridgeRouterHub::receiveMessage() "directly".

Description

Brief/Intro

The BridgeRouter.sol file is the base contract for BridgeRouterHub.sol and BridgerouterSpoke.sol. BridgeRouterHub contains sensitive functions hence its function calls are restricted. Eg: only pre-inputed IBridgeAdapter contracts / interfaces (by the MANAGER_ROLE via addAdapter function)would be able to call BridgeRouterHub::receiveMessage(). This is the protocols intended security architecture. However, a potential issue can arise where anyone (any malicious Smart contract) will be able to call this sensitive funcion BridgeRouterHub::receiveMessage() which is a gateway for many other senitive executions. The smatr contrat is meant to mitigate itself from possibly reaching this state. Unfortunately it doesnt.

Impact Details

A really wide range of impacts.

Note

  1. This vulnerbility is not categorized as critical due to protocol MANAGER_ROLE error required to achieve critical impact.

  2. That pointed out, its still a huge error for Smart contract to potentially allow this. Hence a High

  3. Note that the range of potential attacks to be carrired out via this one bug is numerous as atttacker can take any of the actions define in the enum Action.

Mitigation

References

Add any relevant links to documentation or code

Proof of concept

Proof of Concept

POC illustration (An overly simplified version of the BridgeRouter used for foundry testing)

Alteration in BridgeRouter.sol (for simplicity)

POC Foundry

Last updated

Was this helpful?