DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: high
Invalid

User can call Tractor blueprint through Farm and collect excess ETH

Summary

Blueprint executor might steal excess eth

Vulnerability Details

When calling anything through farm with ETH, s.sys.isFarm is set to 2. This tells the contract to not refund any excess eth until the transaction ends.

function farm(
bytes[] calldata data
) external payable fundsSafu withEth returns (bytes[] memory results) {
results = new bytes[](data.length);
for (uint256 i; i < data.length; ++i) {
results[i] = LibFarm._farm(data[i]);
}
}
modifier withEth() {
if (msg.value > 0) s.sys.isFarm = 2;
_;
if (msg.value > 0) {
s.sys.isFarm = 1;
LibEth.refundEth();
}
}
}

However, this can be used by a blueprint executor, to set the flag to not return any excess eth. Then if the blueprint includes action that should usually refund the eth (such as LibWeth.deposit), it will not be done and it will be saved for the executor at the end.

Impact

Blueprint executor can steal excess eth

Tools Used

Manual review

Recommendations

Fix is non-trivial

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

deadrosesxyz Submitter
about 1 year ago
deadrosesxyz Submitter
about 1 year ago
giovannidisiena Auditor
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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