Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Broker Account Token Reception Issues

Summary

Broker Account Token Reception Issues

Vulnerability Details

/// @dev See the documentation for the user-facing functions that call this internal function.
function _depositViaBroker(uint256 streamId, uint128 totalAmount, Broker memory broker) internal {
// Check: verify the `broker` and calculate the amounts.
(uint128 brokerFeeAmount, uint128 depositAmount) =
Helpers.checkAndCalculateBrokerFee(totalAmount, broker, MAX_FEE);
// Checks, Effects, and Interactions: deposit on stream.
_deposit(streamId, depositAmount);
// Interaction: transfer the broker's amount.
_streams[streamId].token.safeTransferFrom({ from: msg.sender, to: broker.account, value: brokerFeeAmount });
}

/// @param account The address receiving the broker's fee.
/// @param fee The broker's percentage fee charged from the deposit amount, denoted as a fixed-point percentage where
/// 1e18 is 100%.
struct Broker {
address account;
UD60x18 fee;
}

https://github.com/Cyfrin/2024-10-sablier/blob/8a2eac7a916080f2022527408b004578b21c51d0/src/types/DataTypes.sol#L8C1-L16C2

The code assumes the broker.account can always receive tokens, but there are several scenarios where this might fail.

If broker.account is a smart contract, it might not implement logic to handle incoming tokens. The contract might lack a token reception interface. Some contracts might actively reject token transfers. Some could have blacklist mechanisms or Might be temporarily paused. The contract does not check for any of these. It only checks if the broker is a zero address.

Impact

Tokens could become permanently stuck or waste of gas due to reverts

Tools Used

Manual Review

Recommendations

Always validate broker accounts before attempting transfers. Consider implementing a broker whitelist

Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Known issue
inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.