Repository navigation
fix(incentive): bound a same-root voucher's full claim by the cap - #2748
Merged
Merged
Conversation
A voucher that repeats the live root keeps the verified frontier and adopts its own chunk_price, so its claim is amount + verified_index × chunk_price. advance_presigned checked only amount against the cap, so a bump just under the cap credited up to a chain of chunks past it. Check the full claim, as advance_preimage does for a reveal. Closes #2700 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change limiting same-root voucher claims to the lane’s spending cap.
No open issues 🎉
What changed in this PR
Fixes #2700 by bounding a same-root voucher’s full claim by the lane’s spending cap, preventing off-chain credit that the contract cannot pay.
Changes:
- Rejects claims above the cap, including the retained verified frontier valued at the voucher’s adopted price.
- Adds regression coverage for exact-cap acceptance, over-cap rejection, and repricing.
- Documents the security fix in the changelog.
| File | Description |
|---|---|
| crates/incentive/src/lane/tests.rs | Tests same-root claim limits and price changes. |
| crates/incentive/src/lane.rs | Enforces and documents the full-claim cap check. |
| CHANGELOG.md | Records the security fix and associated advisory. |
Review effort: Balanced
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 3 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
GHSA-jr93-46mf-88wx (low bundle). A voucher that repeats the live root keeps the verified frontier and adopts its own
chunk_price, so its claim isamount + verified_index × chunk_price.LaneState::advance_presignedchecked onlyamountagainst the cap, so a same-root bump just under the cap credited up to one chain of chunks past it (at most $0.255 per lane atMAX_RATE). The contract never pays that excess. The reveal path (advance_preimage) already checks the full claim; the voucher path now does the same and refuses withCapExceeded.Closes #2700
Reviewer notes
advance_presigned, after the price is adopted, so it values the kept frontier at the voucher's price. The existingamount > capcheck stays: it covers the rollover branch, where the new epoch starts at index 0.CredentialView::of), and a refusal maps toSpendingCapExhausted, the same recovery an over-cap voucher already takes.Verification
crypto-bigintadvisory, warn-only, already on main)cargo clippy -p decdn-incentive --all-targets --all-features -- -D warningscargo nextest run --workspace: 6157 passedfix(incentive): …, lowercase subjectCHANGELOG.mdSecurity entrya_same_root_voucher_whose_frontier_crosses_the_cap_is_refusedfails.🤖 Generated with Claude Code