Adding pair of the same foreignAsset would replace oracle of earlier entry
Oracles were stored keyed only by the foreign asset rather than by the specific trading pair, so adding a new pair for an asset that already had one silently overwrote the oracle used by the earlier pair. An attacker or careless admin adding a pair could therefore change the price source for an existing pair unexpectedly.
Submitted by gzeon
Oracles are mapped to the foreignAsset but not to the specific pair. Pairs with the same foreignAsset (e.g. UniswapV2 and Sushi) will be forced to use the same oracle. Generally this should be the expected behavior but there are also possibility that while adding a new pair changed the oracle of an older pair unexpectedly.
Proof of Concept
oracles[foreignAsset] = oracle;
Recommended Mitigation Steps
Bind the oracle to pair instead
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 oracle mapping is keyed by the foreign asset alone instead of by the asset pair, so a second registration for the same asset overwrites the first entry.
Impact
Adding a new pair for an asset that already has one could silently change the oracle used by the older pair, potentially feeding it incorrect prices.
What the attacker needed
Ability to add a pair for an existing asset
The fix
The oracle should be bound to the specific pair rather than to the foreign asset alone.
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.
A price oracle is the component that tells a contract what an asset is worth. Here the contract saved one oracle per asset instead of one per trading pair, so registering a second pair for the same asset replaced the oracle the first pair was relying on, which could make that first pair report wrong prices.
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.