Unbounded capExponent growth in MultiFlowPump.update() allows oracle manipulation and illegitimate minting of protocol-native assets
Report ID
#44197
Report Type
Smart Contract
Has PoC
Yes
Target
https://arbiscan.io/address/0xBA150002660BbCA20675D1C1535Cd76C98A95b13
Impacts
- Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
- Illegitimate minting of protocol native assets
- Permanent freezing of funds
- Exploit is possible but is exclusively prevented by an invariant
- Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
Details
The MultiFlowPump contract used within Basin permits unbounded exponential growth of the capExponent parameter due to the absence of a maximum time delta cap in the update() function. If an attacker delays calling update() for an extended period (e.g., an hour), they can inflate the allowable reserve delta due to capExponent scaling with time. This leads to a bypass of MEV-resistant logic and enables attacker-controlled manipulation of the pump's geometric EMA and cumulative SMA. In downstream protocols that depend on these oracle values (e.g., for minting LP tokens or determining liquidity value), this manipulation can result in illegitimate minting, theft, or corruption of protocol accounting.
Vulnerability Details
The update() function in MultiFlowPump.sol relies on the following logic to compute capExponent, which governs how much reserves are allowed to change based on the elapsed time:
uint256 capExponent = ((deltaTimestamp - 1) / capInterval + 1);deltaTimestampis the time elapsed since the lastupdate()call.capIntervalis set by the caller (e.g., 3 seconds).- The formula has no upper bound, meaning a delay of 1 hour with
capInterval = 3results in:
capExponent = ((3600 - 1) / 3) + 1 = 1200This capExponent is then used to exponentially relax limits on reserve changes in _capReserves, which feeds into both _capRates and _capLpTokenSupply. For instance:
bytes16 tempExp = ABDKMathQuad.ONE.add(crp.maxRateChanges[i][j]).powu(capExponent);When capExponent is large, tempExp becomes very high (e.g., >10x), effectively removing any meaningful reserve bounds.
Using this mechanism, an attacker can:
- Wait long enough (or use
evm_increaseTimein a simulated exploit). - Inflate one reserve by an arbitrarily large factor (e.g., 40x).
- Call
update()again. - The manipulated reserve is accepted and stored in the EMA and SMA oracles.
- Any downstream logic relying on these values (LP minting, price logic, etc.) becomes corrupted.
This was successfully demonstrated in a Hardhat PoC (code available).
Impact Details
- Funds at Risk: All LP token-based pools or BEAN-minting mechanisms that rely on reserve values or time-weighted averages from the MultiFlowPump.
- Manipulated Pricing: The pump's oracles become attacker-controlled, enabling mispricing of swaps.
- Illegitimate Minting: LP tokens (or BEAN) may be minted based on fake reserve values.
- Permanent Oracle Corruption: EMA and SMA can be corrupted permanently by a single malicious update.
- Protocol Disruption: If downstream contracts (e.g., Pipeline, Well functions, Curve-based strategies) depend on these values, they may enter an invalid state or halt.
- Theft of protocol-native assets (e.g., LP tokens)
- Extraction of stablecoins or valuable tokens due to incorrect price logic
- Pool imbalance and solvency errors
- Abuse of manipulation-resistant logic meant to defend against MEV
References
- https://arbiscan.io/address/0xBA150002660BbCA20675D1C1535Cd76C98A95b13
- https://github.com/BeanstalkFarms/Basin/blob/master/src/pumps/MultiFlowPump.sol
Critical Logic: capExponent = ((deltaTimestamp - 1) / capInterval + 1);
Proof of Concept
MockWell.sol Contract
MultiFlowPumpMinimal.sol
Test Script (Hardhat)
Running the PoC
npx hardhat node --fork <arbitrum_node_url>
npx hardhat run scripts/basin.js --network localhostResults
Initial update...
Applying manipulated reserves...
Final reserves: [ '1000000000000000000000', '100000000000000000000' ]This demonstrates that the MultiFlowPump accepted reserves 10x higher than the original after a 1-hour delay, bypassing the designed MEV resistance via exponential capExponent inflation. In real scenarios, this could manipulate pool state, TWAPs, or mint excess assets.
BIC Response
We have closed this report and marked it as spam for the following reason:
AI Report: The submission is poorly formatted, likely made by AI and not proofread. The report's content is invalid as well.