Case Study: Arbitrum DeFi Lending Vault Audit — Reentrancy Risk and Deposit Redirection Vulnerability
Executive Summary
This contract implements a DeFi lending vault that accepts token deposits and issues vault shares in return. The contract contains a reentrancy vulnerability in its token approval callback — a function that invites an external contract to call back into the vault mid-execution, before the vault's own accounting has been updated.
A second high-severity flaw allows any caller of the permit-based deposit function to specify an arbitrary destination address for the shares, meaning an attacker can redirect another user's deposit to their own wallet. A tautological zero-address validation check provides no actual protection because the logical condition is always true regardless of the input.
The vault's most privileged key — which controls fund withdrawals — is held by a single address with no multisig requirement. Five medium-severity findings include missing slippage protections and rounding behavior that consistently favors the protocol over users. Eight low-severity findings cover incomplete input validation and event emissions.
Risk Assessment
This vault has four high-severity vulnerabilities that could allow direct loss of deposited funds, including a reentrancy vector and a deposit-redirection flaw. The protocol requires significant remediation before it can be considered safe for user funds.
Key Findings
Tautological Zero-Address Check Using OR Instead of AND
What We Found
The contract is supposed to reject any transaction that sends tokens to or from a zero (invalid) address. The check was written with OR logic instead of AND logic, which means the condition is mathematically always true and never actually blocks anything. An invalid zero address passes through every time.
Why It Matters
Zero-address validation never triggers, allowing deposits and withdrawals to be directed to the zero address and permanently burning tokens with no error or warning.
What Should Be Done
Replace the OR condition with an AND condition in the zero-address check so that the transaction reverts if either the sender or recipient is the zero address.
Reentrancy in approveAndCall() — Arbitrary External Callback After State Change
What We Found
The vault has a function that allows users to approve a token spend and immediately trigger a callback to an external contract in a single transaction. The problem is that the vault's own balance and share records are not updated before the external contract is called. An attacker can write a malicious contract that, when called back, calls into the vault again — draining funds a second time before the first withdrawal is recorded.
Why It Matters
An attacker can chain repeated withdrawals within a single transaction before any balance updates are recorded, draining vault funds far beyond their actual deposit.
What Should Be Done
Apply the checks-effects-interactions pattern: update all internal state before making any external call, and add a reentrancy guard modifier to the approveAndCall function.
depositWithPermit() — Caller-Controlled 'to' Parameter Enables Token Redirection
What We Found
When a user deposits tokens using the permit signature flow, the function accepts a destination address as a parameter from the caller — not from the original token owner. This means a third party who has obtained a valid permit signature can call this function and send the resulting vault shares to their own wallet instead of the actual token owner's wallet.
Why It Matters
Any holder of a valid permit signature can redirect vault shares issued from another user's deposit to an attacker-controlled address, permanently stealing the deposited value.
What Should Be Done
Remove the caller-controlled to parameter and replace it with msg.sender or, where delegation is genuinely intended, require an explicit on-chain approval from the token owner for the destination address.
Single Vault Key — Critical Centralization and Fund Drain Risk
What We Found
One single private key controls the most powerful administrative function in the vault: the ability to withdraw funds. There is no second signer required, no time delay, and no emergency pause. If this key is ever lost, stolen, or compromised, all funds in the vault can be drained immediately and irreversibly.
Why It Matters
A single compromised key enables immediate and complete drainage of all user funds held in the vault with no mechanism to pause or recover.
What Should Be Done
Replace the single admin key with a multisig wallet requiring at least 2-of-3 signers for any fund movement, and implement a timelock on administrative withdrawals.
What a Secure Contract Should Have
Disclaimer: This case study is published for educational purposes only. It reflects the state of the analyzed contract at the time of audit and does not constitute investment advice, an endorsement, or a guarantee of security. Smart contracts may be modified after an audit. HyperAudit is not liable for losses arising from interaction with any contract referenced in this report. Project names and addresses have been removed to protect ongoing remediation efforts. For a full audit of your own contracts, visit hyperaudit.io.
Building a project?
Get the same depth of analysis on your own contracts before you deploy. Reports delivered in hours, not weeks.
Audit Your ContractThinking about buying a token?
Before you buy, find out if the contract is safe. We can audit any token on any EVM chain and tell you exactly what risks you're taking — in plain language you can act on.
Check a Token Before You Buy