The Standard

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

Reentrancy risk on `LiquidationPool::decreasePosition` function may cause steal funds

Vulnerability Details

There is a basic reentrancy vulnerability in decreasePosition function that allows malicious users to steal all the steaked tokens. Here is the attack path:

  1. Malicious user deposits TST and EUROs tokens with increasePosition function (from Attack contract)

  2. He waits 1 day to make these pending stakes to position stake

  3. He calls an attack function from the same Attack contract that calls decreasePosition function

  4. Finally Attack contract's fallback function calls continuously to decreasePosition until all tokens drained

Impact

Malicious user can steal all TST and EUROs in the LiquidationPool contract.

Tools Used

Manual Review

Recommendations

Do the TST subtraction and EUROs subtraction before safetransfer functions. Use nonReentrant modifier.

Updates

Lead Judging Commences

hrishibhat Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

pendingstake-dos

hrishibhat Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

pendingstake-high

Support

FAQs

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

Give us feedback!