Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: high
Valid

`DeliveryPlace::settleAskTaker` Sends Bid Maker the Wrong Token, Leading to DoS and Loss of Funds

Summary

The DeliveryPlace::settleAskTaker function sends the wrong token to the Bid maker, leading to a Denial of Service (DoS) and potential loss of funds.

Vulnerability Details

In the DeliveryPlace::settleAskTaker function, the protocol sends the wrong token to the Maker being settled. As shown in the code snippet below, the token that is attempted to be sent to the maker (offerInfo.authority) is makerInfo.tokenAddress instead of marketplaceInfo.tokenAddress.

tokenManager.addTokenBalance(
TokenBalanceType.PointToken,
offerInfo.authority,
@> makerInfo.tokenAddress,
settledPointTokenAmount
);

Difference Between makerInfo.tokenAddress and marketplaceInfo.tokenAddress:

Impact

This vulnerability leads to two critical issues:

  1. DoS (Denial of Service):

    • The function may revert if the user does not have the necessary approval set for the collateral token.

    • Even if the allowance is set, the function can still revert due to an insufficient balance, as the caller was not expecting to send that particular token.

  2. Loss of Funds:

    • Incorrect conversion of tokens can occur, leading to a loss of funds for either the caller or the receiver. For example, 10 units of USDC is not the same as 10 units of WETH.

Tools Used

Manual

Recommendations

Change makerInfo.tokenAddress to marketplaceInfo.tokenAddress.

tokenManager.addTokenBalance(
TokenBalanceType.PointToken,
offerInfo.authority,
- makerInfo.tokenAddress,
+ marketplaceInfo.tokenAddress,
settledPointTokenAmount
);
Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-DeliveryPlace-settleAskTaker-closeBidTaker-wrong-makerinfo-token-address-addToken-balance

Valid high severity, In `settleAskTaker/closeBidTaker`, by assigning collateral token to user balance instead of point token, if collateral token is worth more than point, this can cause stealing of other users collateral tokens within the CapitalPool contract, If the opposite occurs, user loses funds based on the points they are supposed to receive

Support

FAQs

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