audit: reentrancy + griefing red-team 2026-05-16#139
Open
tangletools wants to merge 1 commit into
Open
Conversation
3 medium / 2 low / 1 informational. No critical or high-severity issues. Medium: `_distributeBill` push to BSM-resolved developer recipient can be permanently griefed by a malicious manager; `withdrawRemainingEscrow` has no fallback when the escrow token is broken; `getNonPaymentTerminationPolicy` is invoked without a gas cap, letting a malicious BSM grief the livelock escape. Low: `_settleDisputeBond` strands dispute bonds on executed proposals when the treasury push fails; `_operatorActiveSlashProposals` cap check ordering is inverted (cosmetic). Confirmed clean: every token-moving entry point holds `nonReentrant`; the OpenZeppelin ReentrancyGuard storage slot is genuinely shared across facets via ERC-7201; operator and keeper payments are pull via `_pendingRewards`; self-call gates fire before any state read; CEI ordering holds on every withdrawal / claim / refund path; the subscription livelock escape (`terminateServiceForNonPayment`) is permissionless.
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.
Summary
Read-only red-team audit of the reentrancy and griefing surfaces called out in the brief.
fundService,withdrawRemainingEscrow, billing, claims, slashing, jobs, RFQ, quotes, lifecycle) confirmednonReentrant. The OZ guard storage slot is ERC-7201 namespaced, so it is genuinely shared across diamond facets and the subscription billing self-call todistributeBillWithKeeperruns under the outerbillSubscriptionguard. Operator and keeper payments are pull via_pendingRewards. The livelock escape (terminateServiceForNonPayment) is permissionless. CEI ordering holds on every withdrawal / claim / refund path.Findings
M-1 Developer transfer in
_distributeBillis not griefing-isolated. Same shape as the gap PR #136 closed forclaimRewardsAll. Apply the_forwardStakerSharetry/catch + refund-to-escrow pattern atPaymentsDistribution.sol:209.M-2
withdrawRemainingEscrowhas no fallback path when the escrow token is broken. No admin rescue exists. Either add an admin-rescue or let the owner specify an alternate recipient.M-3
getNonPaymentTerminationPolicyis invoked without a gas cap. Usestry/catchinstead of the gas-bounded raw staticcall pattern already used by_resolveBillAdjustmentBps. Same hygiene gap onquerySlashingOrigin,getHeartbeatInterval,getHeartbeatThreshold. Most important on the livelock-escape path.L-1
_settleDisputeBondstrands the bond when the treasury push fails afterexecuteSlash. Add an admin re-settle or fall back to a pull-credit on the treasury.L-2
_operatorActiveSlashProposalscap check is ordered afterSlashingLib.proposeSlash. Functionally correct, cosmetic.I-1 Clarification:
_claimRewardsTokenSafe's omission ofnonReentrantis correct and confirmed against the OZ source.Full report: docs/audits/REDTEAM-REENTRANCY-GRIEFING-2026-05-16.md
Test plan
_forwardStakerShareshape (refund to escrow, emit marker).try/catchon view hooks withmanager.staticcall{ gas: MANAGER_HOOK_GAS_LIMIT }(...).adminSettleStuckDisputeBondor fall through to_pendingDisputeBondRefunds[treasury].SlashingLib.proposeSlash.