Sherlock AI reported a Critical vulnerability in the
@40acresFinance protocol.
The 40acres team generously allowed us to share the details publicly so others can learn from the finding.
Here’s how the vulnerability worked:
First, veNFTs are a special type of vote-escrowed ERC721 tokens that earn weekly rewards.
40acres gives veNFT holders instant access to loans based on their veNFT’s future revenue.
Each borrower’s veNFT sits inside a personal PortfolioAccount that routes functionality through modular “facets” using the diamond proxy pattern.
The exploit allows an attacker to reclaim their collateral (veNFT) from their PortfolioAccount without repaying the loan.
Check out the aerodromeVote() function below. 40acres has a very cool feature that allows borrowers to vote with their veNFTs held as collateral in 40acres.
The function has the following problem: The loanContract address is not validated, allowing a malicious user to specify an arbitrary contract. This contract could be approved to control the veNFT in the PortfolioAccount, enabling its transfer during the vote() call in the malicious loanContract.
Attack Steps
1) Attacker deploys a malicious contract that implements
ILoan.vote(uint256) to call transferFrom/safeTransferFrom to transfer the approved veNFT.
2) Attacker calls portfolioAccount.aerodromeVote(maliciousContract, tokenId). The portfolio fallback delegates to the facet, which lacks input validation and calls
maliciousContract.vote(tokenId) and transfers the veNFT back to the attacker, even though the loan has not been repaid.
Note: The repetition of the bug causes the lending pool to be drained - doing it once is just taking a loan & stealing your veNFT back.
Impact
Unbacked loans across the system. Any borrower can reclaim their own collateral mid-loan, leading to full insolvency of the lending pool.
Acknowledgements
Thank you to
@defsec_,
@vinica_boy, and
@onthehunt11_ for helping with this writeup.
Important to know: The 40acres team discovered the bug and applied a fix prior to launch
Detected by Sherlock AI
You can see the original issue as generated by Sherlock AI in the next tweet.
The run took 3 hours 59 minutes from start to finish.
Sherlock AI brings security to the development process, scanning commits and call paths early, surfacing high-impact flaws fast, and giving auditors clearer visibility into complex systems. In practice, that means issues like this can be caught and resolved long before audits, bounties, or deployment.
Try Sherlock AI for your protocol today.