Shambolic Opaque Swift
Medium
The lack of validation in setProtocolFeeAddress
will cause a complete denial-of-service (DoS) for all market participants as an admin can set protocolFeeAddress
to a non-payable contract, making fee transfers revert and halting core functionalities.
In ReputationMarket.sol#L1093 the function applyFees
immediately sends ETH to protocolFeeAddress
. However, in setProtocolFeeAddress
, there is no validation to ensure the new address can receive ETH. This omission allows admins to accidentally configure a non-payable address, causing all subsequent fee transfers to fail.
- Admin calls
setProtocolFeeAddress
with a contract address that cannot receive ETH (e.g., no payable fallback). - The protocol sets
protocolFeeAddress
to this invalid address without any checks.
No response
- The admin sets
protocolFeeAddress
to a non-payable contract viasetProtocolFeeAddress
. - A user calls
buyVotes
orsellVotes
, triggering theapplyFees
function. applyFees
attempts to send ETH to the invalidprotocolFeeAddress
, reverting the transaction.- All subsequent fee-based operations fail, causing a complete DoS.
The entire protocol is effectively shut down for fee-based operations because transactions will revert when sending ETH to the invalid address. Users cannot buy or sell votes, and the market is unusable until the admin corrects the address.
No response
- Validate the address: Ensure
protocolFeeAddress
is capable of receiving ETH. One approach is to test-send a minimal amount of ETH before finalizing the change. - Batch Fee Collection: Accumulate fees in the contract, then allow periodic manual withdrawal by the admin. Even if the withdrawal address fails, it won’t break user-facing functionality.