Tadle

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

`DeliveryPlace.closeBidTaker()` and `settleAskTaker()` use wrong token addresses.

Summary

closeBidTaker() and settleAskTaker() use the makerInfo.tokenAddress as a point token address which is incorrect.

Vulnerability Details

In closeBidTaker() and settleAskTaker(), we increase point token amount but use an incorrect token address.

File: DeliveryPlace.sol
195: tokenManager.addTokenBalance(
196: TokenBalanceType.PointToken,
197: _msgSender(),
198: makerInfo.tokenAddress,
199: pointTokenAmount
200: );
384: tokenManager.addTokenBalance(
385: TokenBalanceType.PointToken,
386: offerInfo.authority,
387: makerInfo.tokenAddress,
388: settledPointTokenAmount
389: );

makerInfo.tokenAddress means a collateral token and marketPlaceInfo.tokenAddress should be used instead.

Impact

User's point token balances wouldn't be increased correctly because closeBidTaker() and settleAskTaker() increase the collateral balances instead.

Tools Used

Manual Review

Recommendations

closeBidTaker() and settleAskTaker() should use marketPlaceInfo.tokenAddress instead of makerInfo.tokenAddress.

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.