Skip to content

contracts: SlashJudge challenge submission is front-runnable — mempool copy of the evidence steals the 50% challenger reward #854

Closed

Description

@thiras

Severity: MEDIUM — from the 2026-06-10 full-repository review.

Location

  • contracts/src/SlashJudge.sol:455-467 — _resolve records msg.sender as challenger; EvidenceAlreadyUsed at :456
  • contracts/src/CapacityBond.sol:849-870 / contracts/src/SlashEscrowLib.sol:195-208 — 50% of escrow paid to the recorded challenger at finality

Problem

The slashable evidence (probeResponseData, streamResponseData, the operator's slashSigs) is only revealed in the challenge transaction's calldata. A mempool watcher can copy a pending honest challenge, resubmit with higher gas, and become the recorded challenger — capturing the 50% finality reward (finalizeUnappealedSlash is permissionless). The honest witness's tx then reverts EvidenceAlreadyUsed, wasting their gas. usedEvidenceHash prevents a double-slash but the reward slot is strict first-lander.

Impact

Removes the economic incentive for honest off-path witnesses to surface evidence (their reward is reliably MEV-extracted), weakening the enforcement layer the slashing model depends on. The challenge bond round-trips, so there's no bond loss — but the reward is the actual incentive. Mitigating context: Arbitrum's sequencer-ordered mempool reduces (does not eliminate — e.g. a colluding searcher/timeboost) the classical front-running surface; worth an explicit decision either way.

Not a duplicate

No open issue concerns challenge-submission front-running; ADR 014/028 do not acknowledge the vector.

Fix direction

Commit–reveal on the evidence hash (commit keccak256(evidence, salt, challenger) first, reveal after N blocks with the challenger bound), or bind the reward to a pre-registered challenger commitment rather than the first revealer. Alternatively, document the accepted posture given L2 ordering assumptions.

Activity

  1. added
    kind:security
    design:economics
    prio:medium
    on Jun 10, 2026
  2. added
    design:adr
    on Jun 10, 2026
  3. github-actions commented on Jun 10, 2026

    @github-actions

    🎯 Triage report

    A well-specified security vulnerability in SlashJudge._resolve(): because msg.sender is recorded as the challenger at submission time, a mempool observer can copy the calldata (which contains all slashable evidence), resubmit with higher gas, and capture the 50% finality reward. The honest witness's tx reverts EvidenceAlreadyUsed, and the attack is reliable on any chain with a public mempool. Arbitrum's sequencer ordering reduces (but doesn't eliminate) the classical front-running surface; the timeboost/colluding-sequencer scenario remains live. ADR 014 and ADR 028 do not acknowledge this vector, so an explicit design decision is needed before implementation.

    📊 Assessment

    Dimension Value Reasoning
    Type Bug Contract design flaw — reward attribution is exploitable via mempool copy
    Labels security, economics, medium (existing) + missing-decision, ADR (added) Vector is unacknowledged in ADR 014/028; explicit decision must be recorded before fix ships
    Coding agent Needs more info Fix direction is clear but the team must first choose between commit–reveal and pre-registered commitment; implementation touches SlashJudge, CapacityBond, SlashEscrowLib, and ADR 028

    🔗 Similar issues

    No open issues describe this front-running vector. Searched for challenge submission, MEV, commit-reveal, and ADR 028 / ADR 014 slash surface — no duplicates found.

    💡 Notes and suggestions

    Root cause pinpoint

    SlashJudge._resolve() (:455–467) passes msg.sender directly as challenger to capacityBond.slash(). Because the evidence hash and all proof data are in calldata, any observer can replay the tx with higher gas before it mines.

    // SlashJudge.sol:462 — the challenger address is first-lander only
    (uint256 slashId, uint256 amount) = capacityBond.slash(operator, msg.sender, uint8(offenseType));

    usedEvidenceHash correctly prevents a double-slash but does not protect who receives the 50% reward recorded in SlashRecord.challenger.

    Fix options

    Option A — Commit–reveal (standard pattern)

    1. Add commitChallenge(bytes32 commitment) where commitment = keccak256(abi.encodePacked(evidenceHash, salt, challengerAddr)).
    2. Require the commitment to exist and be at least N blocks old before _resolve() accepts the reveal. Bind challenger to the committed address, not msg.sender.
    3. Trade-off: adds a multi-block delay; must handle expired commits and re-entrancy in the commit store.

    Option B — Pre-registered challenger commitment
    Bind the challenger at challenge bond deposit time (a separate registerChallenger(bytes32 evidenceHashCommitment) step). Reward is attributed to the registered address. Simpler on-chain; requires separate off-chain coordination for new challengers.

    Option C — Accept the risk with documentation
    If the team decides Arbitrum's sequencer ordering is a sufficient mitigant for the PoC phase, document the accepted posture explicitly in ADR 028 §Challenge submission and add a TODO for mainnet hardening. This should be a conscious, recorded decision — not a gap.

    ADR 028 status note

    Per CLAUDE.md, ADR 028 is currently in Draft status (unlocked from "Locked-for-implementation"). This is the right moment to address the vector in the ADR before implementation is hardened. The fix choice should be reflected in ADR 028 §Contract surface.

    Sub-tasks (once option chosen)

    • Record design decision in ADR 028 §Challenge submission (and optionally ADR 014 §Evidence staleness)
    • Implement chosen mechanism in SlashJudge.sol (_resolve / new commit entry point)
    • Update CapacityBond.slash() signature if challenger binding changes
    • Add/extend forge test: front-run scenario — verify honest challenger retains reward
    • Verify forge build --sizes --deny warnings and slither/aderyn pass after changes

    Generated by Agentic Triage for issue #854 · sonnet46 692.7K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  4. added
    design:missing-decision
    on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:adrdesign:economicsdesign:missing-decisionkind:securityprio:medium

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions