Closed code423n4 closed 1 year ago
0xSorryNotSorry marked the issue as primary issue
This seems to be misinterpretting the intended usage of the function. The funds are transferred out of the msg.sender
's wallet by design, not the specified staker
's wallet.
Sidu28 marked the issue as sponsor disputed
Siding with sponsor due to lack of proof around a broken invariant
GalloDaSballo marked the issue as unsatisfactory: Insufficient proof
Hi, @GalloDaSballo
I would like to clarify an example of a scenario that might not satisfy the staker.
When submitting the issue, I was guided by the docs/EigenLayer-deposit-flow.md
documentation.
depositIntoStrategyWithSignature
the new shares are credited to a specifiedstaker
, who must have also signed off on the deposit (this enables more complex, contract-mediated deposits, while a signature is required to mitigate the possibility of griefing or dusting-type attacks).
In the case when the signature is used directly by another user, there is nothing wrong with this, as they will simply transfer their funds to the staker.
However, the situation is different if there are contract-mediated deposits
. Point 3 in Impact - This method ...
Imagine that in the system there are 2 different intermediary contracts (A, B) that provide different opportunities/obligations/conditions.
The user gives permission for them to stake through the logic of contract A. But in fact, anyone can stake through the logic of contract B. This leads to possible problems/loss of benefit.
Although this is all purely theoretical and depends on many other conditions for these contracts to actually be present in the future, not having additional checks, etc.
Perhaps I misunderstood what this enables more complex, contract-mediated deposits, while a signature is required to mitigate the possibility of griefing or dusting-type attacks
means in the context of depositIntoStrategyWithSignature
so I apologize for wasting your time.
Thank you, have a good day
Siding with the sponsor on this one, the caller is "taking" the signature and giving all of the value for this
In lack of a rational reason to grief someone with such generosity, I must maintaining the finding as invalid
I do however, recommend you follow up with the Sponsor once an implementation of the Strategies is known, in case you can produce an exploit
Lines of code
https://github.com/code-423n4/2023-04-eigenlayer/blob/5e4872358cd2bda1936c29f460ece2308af4def6/src/contracts/core/StrategyManager.sol#L268
Vulnerability details
Impact
According to documentation, the
depositIntoStrategyWithSignature
method allows a user (authorized by a staker) to stake it. This is done for:But the
msg.sender
field is missing in the signature, which allows anyone to use the signature and send a transaction on their own behalf (and not from the address where this signature was provided)Theoretical impact:
depositIntoStrategyWithSignature
possibility of griefing attacks
Proof of Concept
We can see the absence of sender in the signature:
Tools Used
Recommended Mitigation Steps
msg.sender
to signature, which will allow you to specify which contract layers can use this signatureAssessed type
Access Control