The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: high
Valid

Missing Access Control on `distributeAssets`

Summary

The LiquidationPool smart contract contains a vulnerability in the distributeAssets function. This function, which lacks proper access controls, can be exploited by attackers to manipulate contract rewards and burn euros in the contract by craft malicious assets input.

Vulnerability Details

The distributeAssets function, designed to be called by LiquidationPoolManager during runLiquidation, can be accessed by anyone due to missing access controls. Attackers can exploit this by crafting a fake assets[] array with a controlled token, deceiving the contract into recognizing it as a legitimate asset.

struct Asset { ITokenManager.Token token; uint256 amount; }
struct Token { bytes32 symbol; address addr; uint8 dec; address clAddr; uint8 clDec; }

Think about the following scenerio:

  • Attacker craft a fake assets[] with his own controlled token("malToken") as the input to call distributeAssets and disguising it with the symbol of a valuable asset in the contract (e.g., USDC).

FakeAsset{
token{
"USDC", // valuable asset's symbol in current contract
malToken,
18,
USDC, // real USDC address
18
},
any amount
}
}
  • Inside the invocation, the reward linked to the USDC will be updated( since the contract using symbol instead of the token address)

rewards[abi.encodePacked(_position.holder, asset.token.symbol)] += _portion;
  • Because the malToken(asset.token.addr) is controlled by attacker, the fake token transfer will be successful

IERC20(asset.token.addr).safeTransferFrom(manager, address(this), _portion);

Impact

  • reward can be manipulated

  • Euros in the contract can be burned

Tools Used

Manual

Recommendations

Adding access control to distributeAssets.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

distributeAssets-issue

Support

FAQs

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