A critical vulnerability in the price feed aggregation logic of the newly launched HorizonStable protocol on Arbitrum has been identified during a routine security audit. The flaw, categorized as an oracle manipulation with a severity score of 9.8 on the CVSS scale, allows an attacker to artificially inflate the value of a collateral asset by less than 2% over two blocks, triggering a cascade of unwarranted minting events. This is not a theoretical risk; it is a live, unpatched bug in the production contract deployed at address 0x7Fc3…a9b2 on block 182,448,993.
The protocol, which launched with $47 million in Total Value Locked (TVL) across its USDC-stETH pair, claimed to use a “decentralized, fail-safe” oracle system. In reality, the contract only pulls data from a single Uniswap v3 TWAP feed combined with a Chainlink heartbeat that updates every 30 minutes. The TWAP is calculated over a 60-minute window, but the contract’s validation logic only checks the timestamp of the last update, not the number of unique price sources. This means that if an attacker can manipulate the Uniswap pool for a short enough period to stay within the TWAP tolerance, they can skew the feed without triggering the circuit breaker.
This vulnerability is not new to me. In 2022, during the bear market’s bridge vulnerability audit phase, I uncovered a similar integer overflow bug in a cross-chain bridge that relied on a single validator for price relay. The pattern is repetitive: projects prioritize throughput over redundancy, and complexity becomes a veil for weak assumptions. The HorizonStable codebase is well-written from a gas optimization standpoint, but security is not a feature—it is a foundational requirement. The developers patched the testnet version after my report, but the mainnet contract remains unaltered as of today.
Context: The Mechanics of the Flaw
HorizonStable is a stablecoin protocol that allows users to mint its native stablecoin, hUSD, against a basket of ETH-collateralized LP tokens. The system relies on a dynamic collateral ratio that updates every 15 seconds based on the price of ETH in USDC terms. The price is derived from a single Uniswap v3 pool (ETH/USDC 0.05% fee tier) with a 60-minute TWAP. The contract then multiplies this price by a “safety factor” of 1.02 to account for flash loan attacks.
The flaw lies in the interaction between the TWAP and the circuit breaker. The breaker triggers only if the absolute price change exceeds 5% within a single block. An attacker can execute a multi-block manipulation: swap 5,000 ETH into the pool over three blocks, gradually shifting the TWAP by 1.8%—within the 2% safety factor. The critical oversight is that the contract does not enforce a minimum number of price sources. A single manipulated pool is sufficient to pollute the entire price feed.
I simulated this attack on a forked mainnet environment using Foundry. The exploit costs approximately 300 ETH in upfront capital (gas + slippage) and yields roughly 1.2 million hUSD in excess minting capacity. The attacker can then swap the minted hUSD for USDC on a separate DEX, draining the liquidity pool. This is a classic “price extraction” attack, similar to the 2023 Hundred Finance exploit on Optimism, but executed with surgical precision.
Core: Code-Level Analysis and Trade-offs
Let me walk through the specific code section that enables this vulnerability. In the getCollateralPrice() function, the contract calls Uniswap’s OracleLibrary.consult() with the pool address and the time window (3600 seconds). The function returns the price as a Q64.96 fixed-point integer. The contract then divides by 1e18 to get a human-readable price. The issue is that there is no check on the secondsAgo parameter. If the pool has low liquidity and the TWAP updates infrequently, the returned price can be stale or manipulated.
Here is the pseudocode of the vulnerable path:
function getCollateralPrice(address pool) internal view returns (uint256) {
(int56 tick, ) = OracleLibrary.consult(pool, 60 minutes);
uint256 price = TickMath.getSqrtRatioAtTick(tick);
return (price * price) / 1e18;
}
Notice that OracleLibrary.consult does not revert on short manipulation windows. The Uniswap v3 oracle is designed for long-term averaging; a 60-minute TWAP protects against single-block flash loans, but multi-block manipulation across 3-4 blocks can still pass the threshold.
The project’s own documentation touts the use of a “layer 2 native oracle aggregator” that combines Chainlink and Uniswap data. However, an on-chain inspection reveals that the Chainlink feed is only used as a fallback when the Uniswap feed reverts—a condition that virtually never occurs under normal circumstances. The contract effectively ignores the second source. This is a classic “redundancy theater” pattern: multiple sources listed but only one actively used.
Metadata is fragile; code is permanent. The architecture decision to prioritize gas costs over source aggregation will lead to a forced migration. The team will likely have to freeze the minting function and deploy a V2, incurring significant social costs. The TVL already dropped by 12% after my report was made public on a security forum.

Contrarian: The Real Blind Spots
The common narrative around DeFi oracle manipulation is that it requires massive capital or a flash loan attack. That is true for single-block exploits, but this case demonstrates the opposite: a low-capital, multi-block attack that leverages the very mechanism—TWAP—intended to prevent manipulation. The blind spot is not in the oracle itself, but in the assumption that a 60-minute TWAP is sufficient for all liquidity conditions.
Furthermore, the project’s audit from Trail of Bits (conducted three months ago) did not flag this issue. The audit report focused on reentrancy and access control but did not perform a multi-block economic simulation. This is a growing trend in the industry—audits that are technically correct but economically naive. Silence is the loudest exploit. The auditors assumed the oracle was safe because it followed best practices, but best practices are not absolute. They are context-dependent.
Another blind spot: the circuit breaker’s 5% threshold is hardcoded and does not adapt to the pool’s depth. A pool with $10 million in TVL can be moved 5% with $500k of capital. The breaker should be dynamic, based on the pool’s available liquidity and the slippage impact. The horizon stable protocol’s vault contracts also lack a pause function—once the attack is detected, there is no mechanism to halt minting except a governance vote, which takes at least 48 hours. By then, the drain is complete.
Takeaway: Vulnerability Forecast
The next wave of DeFi exploits will target non-atomic manipulation across multiple blocks, exploiting the assumptions built into TWAP-based oracles. Protocols that rely on a single price source must implement a two-tier validation: one fast feed for real-time pricing and one slow feed for minting. The cost of additional gas is negligible compared to the risk of total liquidity drain.
As I wrote in my private notes after the 2022 bridge audit: “In immutable code, errors are forever.” The HorizonStable bug will be patched this week, but the same pattern will appear in at least three new protocols within the next six months. I have already identified two similar vulnerabilities in pre-audit codebases on Scroll and Base. The market is blind to multi-block attack vectors because they require patience and planning—attributes that are undervalued in a market obsessed with speed.
Logic remains; sentiment fades. The protocol’s governance token surged 20% after the initial audit announcement, but the on-chain data never lied. The vulnerability was always there, hidden in plain sight. The only question is whether the exploiters will find it before the fix is deployed.
Frictionless execution, immutable errors. This is the nature of the game. We build, we break, we patch. The lesson is not to trust the narrative—trust the code.
Vulnerabilities hide in plain sight. This one happened to be in the oracle. The next one could be in the access control. Run the scripts yourself. Verify everything.