No setter for exchangeRateFeeder, whose address might change in future
The BaseStrategy contract lacks a setter to update the exchangeRateFeeder address, which EthAnchor documentation says may change. If the address changes, the strategy would use an outdated feeder, leading to inaccurate calculation of the vault's total invested assets.
Submitted by kenzo
EthAnchor’s docs state that “the contract address of ExchangeRateFeeder may change as adjustments occur”. BaseStrategy does not have a setter to change exchangeRateFeeder after deployment.
Impact
Inaccurate/unupdated values from exchangeRateFeeder when calculating vault’s total invested assets.
While the strategy’s funds could be withdrawn from EthAnchor and migrated to a new strategy with correct exchangeRateFeeder, during this process (which might take time due to EthAnchor’s async model) the wrong exchangeRateFeeder will be used to calculate the vault’s total invested assets. (The vault’s various actions (deposit, claim, withdraw) can not be paused.)
Proof of Concept
The exchangeRateFeeder is being used to calculate the vault’s invested assets, which is used extensively to calculate the correct amount of shares and amounts: (Code ref)
function investedAssets() external view virtual override(IStrategy) returns (uint256) {
uint256 underlyingBalance = _getUnderlyingBalance() + pendingDeposits;
uint256 aUstBalance = _getAUstBalance() + pendingRedeems;
return underlyingBalance + ((exchangeRateFeeder.exchangeRateOf(address(aUstToken), true)
* aUstBalance) / 1e18);
}
EthAnchor documentation states that unlike other contracts, exchangeRateFeeder is not proxied and it’s address may change in future: “the contract address of ExchangeRateFeeder may change as adjustments occur. ” (ref)
Recommended Mitigation Steps
Add a setter for exchangeRateFeeder.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the contract hardcodes the exchangeRateFeeder address without providing a mechanism to update it, despite documentation warning that the address may change.
Impact
If the exchangeRateFeeder address changes, the strategy would use the wrong feeder, causing inaccurate calculation of the vault's total invested assets until funds are migrated, which could take time due to EthAnchor's async model.
What the attacker needed
ExchangeRateFeeder address changes
The fix
Add a setter function to allow updating the exchangeRateFeeder address.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This report is about a smart contract that relies on an external contract (exchangeRateFeeder) to calculate how much money is invested. The external contract's address might change in the future, but the strategy contract has no way to update it, so it would keep using the old address and give wrong numbers.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.