You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reentrancy Vulnerability in Rewards Extraction (extractInternal)
Summary
The lack of a reentrancy guard in the extractInternal function will cause a complete loss of funds for the vault as an attacker will deploy a malicious contract as rwd_address to reenter the vault and execute unauthorized actions during reward extraction.
1-rwd_address must be set to a contract controlled by the attacker.
2-The vault must contain sufficient lstToken liquidity for the initial reward transfer.
3-The function extractRewardsNoRequire must calculate a valid rwd value to trigger extractInternal.
External pre-conditions
1-A transaction must trigger extractRewardsNoRequire (e.g., through a buy, sell, or manual call).
2-The malicious rwd_address contract must include a fallback function that can reenter the vault.
Attack Path
-The attacker deploys a contract with the following fallback function:
Refined Bone Bat
High
Reentrancy Vulnerability in Rewards Extraction (extractInternal)
Summary
The lack of a reentrancy guard in the
extractInternal
function will cause a complete loss of funds for the vault as an attacker will deploy a malicious contract asrwd_address
to reenter the vault and execute unauthorized actions during reward extraction.Root Cause
In NumaVault.sol:363-364, the call to
rwd_address.call()
in extractInternal does not include a reentrancy guard or proper validation. This allows a malicious contract deployed asrwd_address
to exploit the vault by reentering during the reward extraction process.https://github.com/sherlock-audit/2024-12-numa-audit/blob/main/Numa/contracts/NumaProtocol/NumaVault.sol#L363-L364
Internal pre-conditions
1-rwd_address must be set to a contract controlled by the attacker.
2-The vault must contain sufficient lstToken liquidity for the initial reward transfer.
3-The function extractRewardsNoRequire must calculate a valid rwd value to trigger extractInternal.
External pre-conditions
1-A transaction must trigger extractRewardsNoRequire (e.g., through a buy, sell, or manual call).
2-The malicious rwd_address contract must include a fallback function that can reenter the vault.
Attack Path
-The attacker deploys a contract with the following fallback function:
-The attacker waits until extractRewardsNoRequire is callable (e.g., 24 hours since the last extraction).
-They trigger the extraction by interacting with the vault (e.g., through a buy or sell transaction).
-When
rwd_address.call()
is executed inextractInternal
, the malicious contract’s fallback function is triggered.-The fallback function reenters the vault and performs unauthorized actions (e.g., calling buy or sell to manipulate state or drain funds).
Easy drain Funds:
Impact
Affected Party: The vault and all users.
Loss: Complete depletion of the vault’s liquidity and potential manipulation of internal state.
PoC
Vault holds 1,000 LST tokens; attacker balance is 0.
Mitigation
Add a Reentrancy Guard:
Protect extractInternal and related functions from reentrant calls:
The text was updated successfully, but these errors were encountered: