Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Invalid

Missing check for tokenPerPoint would lead to loss of funds

Summary

In DeliveryPlace.sol, due to the lack of check if the marketPlaceInfo.tokenPerPoint has been set or not, attackers can gain funds.

Vulnerability Details

The marketplace is updated using 2 different functions,

  1. updateMarketPlaceStatus (status is being updated)

  2. updateMarket (rest of the parameters are being updated)

Assume the following scenario,

  1. Owner updates the marketplace status to AskSettling,

  2. The attacker (an ask maker), calls the settleAskMaker() function with _settledPoints = usedPoints.

  3. Since the tokenPerPoint has not been set by the admin, settledPointTokenAmount = 0

    https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/DeliveryPlace.sol#L262-L263

    uint256 settledPointTokenAmount = marketPlaceInfo.tokenPerPoint *
    _settledPoints;
  4. The attacker will have to pay 0 point tokens, and will receive the entire collateral, and the funds given by the taker. Thus making a profit.

Impact

Attacker can unfairly earn a profit without paying the points token.

Tools Used

Manual Review

Recommendations

Add a check to make sure that marketPlaceInfo.tokenPerPoint is set.

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

[invalid] finding-Admin-Errors-Malicious

The following issues and its duplicates are invalid as admin errors/input validation/malicious intents are1 generally considered invalid based on [codehawks guidelines](https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity#findings-that-may-be-invalid). If they deploy/set inputs of the contracts appropriately, there will be no issue. Additionally admins are trusted as noted in READ.ME they can break certain assumption of the code based on their actions, and

Support

FAQs

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