Resubmission with Pause Bypass Potential Exploi
The swap functions on the Puffer Depositor contract were still callable on mainnet despite the team's claim that they were paused, allowing an arbitrary address to invoke them. An attacker could potentially steal a small amount of dust stETH from the current depositor.
Originally disclosed on Immunefi
- Disclosed after under an hour
28646 - [SC - Insight] Resubmission with Pause Bypass Potential Exploi...
Submitted on Feb 22nd 2024 at 23:05:17 UTC by @offside0011 for Boost | Puffer Finance
Report ID: #28646
Report type: Smart Contract
Report severity: Insight
Target: https://etherscan.io/address/0x7276925e42f9c4054afa2fad80fa79520c453d6a
Impacts:
- Theft of unclaimed yield
Description
This is a resubmission of #28611 and #28614
Please refer to the previous submissions for technical details: https://bugs.immunefi.com/dashboard/submission/28611 https://bugs.immunefi.com/dashboard/submission/28614
Vulnerability
Dust stETH could still be stolen from the current depositor.
These issues are already documented in the audit reports from BlockSec and Quantstamp, and the Puffer Team has been notified.
Explanation
In response to the previous issue, the team confirmed that:
Puffer Depositor swap functions are in scope, but due to them being paused bugs will only be considered if they can bypass the pause mechanism.
However, these swap functions are still accessible on the mainnet. We have already demonstrated the vulnerability (the misconfiguration) in our previous POC, which can be found at https://bugs.immunefi.com/dashboard/submission/28614. The POC successfully works on block number 19281954.
Recommendation
Currently, only a small amount of dust (approximately $46) is vulnerable. The functions should be paused.
Proof of Concept
We demonstrated the accessibility of the swap functions by checking the authority (AccessManager) of the depositor.
# cast bn
19284511
# cast sig 'swapAndDeposit1Inch(address,uint256,bytes)'
0x9b207f4a
# cast call 0x8c1686069474410E6243425f4a10177a94EBEE11 'canCall(address,address,bytes4)(boo
l,uint32)' 0x1111111111111111111111111111111111111111 0x4aA799C5dfc01ee7d790e3bf1a7C2257CE1DcefF 0x9b207f4a
true
0
The result indicates that an arbitrary address (0x1111111111111111111111111111111111111111) can call the depositor (0x4aA799C5dfc01ee7d790e3bf1a7C2257CE1DcefF) using the selector of the swap function, swapAndDeposit1Inch(address,uint256,bytes) at block number 19284511.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the pause mechanism was not correctly applied to the swap functions, leaving them callable by any address.
Impact
An attacker could potentially steal a small amount of dust stETH (approximately $46) from the current depositor, as the swap functions were not paused.
What the attacker needed
Swap functions not paused; attacker can call the depositor contract
The fix
The swap functions should be paused.
How it was found
- Check the current block number.
- Compute the function selector for swapAndDeposit1Inch.
- Call the AccessManager's canCall function with an arbitrary address, the depositor address, and the selector.
- Observe that the result is true, meaning the arbitrary address is allowed to call the swap function.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract has functions that let users swap tokens. The team said these functions were paused, but the report shows they were not actually paused. Anyone could still call them, which might let someone take a small amount of leftover tokens from another user.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.