The claimLSDTokens function in the contract lacks robust input validation. Due to this lack of validation, a malicious user could submit arbitrary values for _amount, _sharesAmount, and an invalid Merkle Proof. This vulnerability enables unauthorized token claims, potentially leading to a significant loss of assets or manipulation of the staking pool state.
The claimLSDTokens function is designed to allow users to claim withdrawable liquid staking tokens by providing the amount they wish to claim, their share amount, and a Merkle Proof. However, this function does not sufficiently validate these inputs, leaving it susceptible to abuse. An attacker can exploit this lack of validation by:
Supplying Arbitrary _amount or _sharesAmount: Without any validation to ensure the values align with the user’s actual holdings or claim eligibility, attackers could claim larger amounts than they should be able to.
Invalid Merkle Proof: If an invalid Merkle Proof bypasses verification, attackers could submit claims with manipulated values that are difficult to detect.
Effect on Staking Pool State: This can drain assets or disrupt pool accounting if unauthorized claims alter the balance of available staking tokens.
PoC:
In this scenario, assume User A has claimed 50 tokens legitimately. However, due to the lack of input validation, User A can submit an arbitrary, higher _amount or _sharesAmount than what they’re eligible for and receive additional tokens beyond what they are entitled to.
Explanation:
We create a scenario where stakingContract holds a supply of tokens and provides User A with a valid balance.
In the test case, an attacker submits an invalid Merkle Proof and arbitrary values for _amount and _sharesAmount that exceed the legitimate claims.
Since claimLSDTokens lacks validation for these inputs, the contract allows the attacker to receive tokens without meeting eligibility, bypassing ownership restrictions.
If exploited, this vulnerability allows malicious users to:
Withdraw tokens exceeding their actual claim.
Manipulate the balance and state of the staking pool, potentially draining tokens and destabilizing the staking system.
This would lead to significant loss of assets, rendering the staking system unreliable and diminishing user trust.
Manual review.
To secure the contract against such exploits:
Input Validation for _amount and _sharesAmount: Check if the _amount and _sharesAmount align with the user’s legitimate claim.
Strong Merkle Proof Verification: Ensure only valid and verified Merkle proofs are processed by updating the Merkle root at each state change.
Rate-Limit Claims: Implement restrictions on how frequently a user can call claimLSDTokens to prevent excessive claims and state manipulation.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.