-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unrestricted Asset Approval in NodeDelegator. #70
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-b
insufficient quality report
This report is not of sufficient quality
primary issue
Highest quality submission among a set of duplicates
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Comments
c4-submissions
added
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
labels
Nov 11, 2023
c4-pre-sort
added
the
insufficient quality report
This report is not of sufficient quality
label
Nov 15, 2023
raymondfam marked the issue as insufficient quality report |
c4-pre-sort
added
the
primary issue
Highest quality submission among a set of duplicates
label
Nov 15, 2023
raymondfam marked the issue as primary issue |
Intended design callable only by the manager. |
This was referenced Nov 15, 2023
Open
Agree that the max approval without ability to rescind approval adds risk, but the risk is accepted by Kelp. QA |
fatherGoose1 changed the severity to QA (Quality Assurance) |
c4-judge
added
downgraded by judge
Judge downgraded the risk level of this issue
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
grade-b
and removed
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
labels
Nov 29, 2023
fatherGoose1 marked the issue as grade-b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-b
insufficient quality report
This report is not of sufficient quality
primary issue
Highest quality submission among a set of duplicates
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/NodeDelegator.sol#L35-L46
https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/NodeDelegator.sol#L44
https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/NodeDelegator.sol#L45
Vulnerability details
Impact
The
maxApproveToEigenStrategyManager
function grants unlimited approval to an external contract to transfer assets from the NodeDelegator contract. This could allow loss of funds if the external contract is compromised.Proof of Concept
maxApproveToEigenStrategyManager approves max amount of asset to external contract. No way to revoke allowance, so strategy manager contract can potentially drain assets.
The key issue is that it grants unlimited approval to the
EigenStrategyManager
external contract to transfer assets:The problems with this are:
There is no way to revoke or reset this unlimited allowance later
The external EigenStrategyManager could potentially drain assets from the NodeDelegator by transferring them to itself
If the EigenStrategyManager contract is compromised, the attacker could drain assets
The
maxApproveToEigenStrategyManager
function approves the maximumuint256
amount of an asset to the EigenStrategyManager address.EigenStrategyManager
contract, there is no way to revoke it.The Issue
The
maxApproveToEigenStrategyManager
function in NodeDelegator provides unlimited approval to the external EigenStrategyManager contract, with no way to revoke it. This could allow the EigenStrategyManager to drain assets if compromised.Impact
If the
EigenStrategyManager
contract is compromised, the attacker could:Trigger
This could be triggered by:
Maximum impact
Function approves external contract to transfer unlimited amounts
External contract has balance of 1000 DAI
If compromised, attacker can drain all 1000 DAI
Maximum loss is full balance of given asset approved
A step-by-step explanation from root cause to impact
NodeDelegator has 1000 DAI
Attacker compromises external contract
NodeDelegator calls
maxApproveToEigenStrategyManager(DAI)
Unlimited DAI approval granted to compromised contract
Attacker uses external contract to transfer 1000 DAI to themselves
Attacker has drained all 1000 DAI from NodeDelegator
Tools Used
Manual review
Recommended Mitigation Steps
revokeApproval
functionincreaseAllowance
anddecreaseAllowance
insteadAssessed type
ETH-Transfer
The text was updated successfully, but these errors were encountered: