Skip to content

reputation: self-reports are accepted — reporter == provider fills one of the three distinct-reporter slots and self-boosts the network score #861

Closed

Description

@thiras

Severity: MEDIUM — from the 2026-06-10 full-repository review (#832 surface).

Location

  • crates/gossip/src/reputation.rs:134-194 — validate_reputation_envelope: no body.reporter == body.provider rejection
  • crates/reputation/src/network.rs:224-287 — record inserts report.reporter into distinct_reporters unconditionally (:284)
  • crates/node/src/reputation_wiring.rs:315-361 — NodeReputationSink::accept: no guard either

Problem

A staked node can sign and gossip reports about itself. Two concrete effects:

  1. The self-report folds into the node's own network_score, weighted by its own settlement value (compute_reporter_weight(reporter)) — a self-vote at up to the 3× cap.
  2. The node counts as one of the three distinct reporters its own score needs. ADR 008's minimum-reporter threshold is explicitly an eclipse/Sybil mitigation; letting self fill a slot drops the external-identity cost from 3 to 2.

Not a duplicate

This is aggregation-rule enforcement inside the new #832 code, not the generic deferred-Sybil flooding posture (ADR 008 §14a). ADR 008 frames reports as about "a node it has interacted with" but no rule enforces it.

Fix direction

Reject reporter == provider in validate_reputation_envelope (new ReputationReject::SelfReport variant), and/or skip the self-insert in network.record / NodeReputationSink::accept. Cheap, fully local change.

Activity

  1. added
    kind:bug
    kind:security
    prio:medium
    rust
    on Jun 10, 2026
  2. github-actions commented on Jun 10, 2026

    @github-actions

    🎯 Triage report

    A staked node can sign and gossip a ReputationReport where reporter == provider, bypassing the ADR 008 distinct-reporter threshold (counts itself as one of three required external reporters) and self-boosting its own network_score at up to the 3× settlement-weight cap. This is a post-#832 enforcement gap at three co-located sites. The fix is fully specified, local, and requires no design discussion.

    📊 Assessment

    Dimension Value Reasoning
    Type Bug Concrete behavioural defect in the merged #832 aggregation code
    Labels unchanged (bug, security, medium, rust) Already accurate; no additions needed
    Coding agent Suitable Exact file paths + line ranges given, a specific new error variant named, no ambiguity in scope

    🔗 Similar issues

    💡 Notes and suggestions

    Fix checklist

    • crates/gossip/src/reputation.rs validate_reputation_envelope (~line 134–194): Add if body.reporter == body.provider { return Err(ReputationReject::SelfReport); } — add SelfReport variant to ReputationReject, increment a reputation_self_report_rejected_total counter for observability
    • crates/reputation/src/network.rs record (~line 284): Guard distinct_reporters.insert(report.reporter) to skip (or return early) when report.reporter == report.provider
    • crates/node/src/reputation_wiring.rs NodeReputationSink::accept (~line 315–361): Add the same reporter == provider guard, consistent with the gossip-layer rejection
    • Tests: test_self_report_rejected in gossip/src/reputation.rs; test_self_report_not_counted_distinct in reputation/src/network.rs

    Implementation notes

    • The gossip-layer rejection is the primary fix (defence in depth — self-reports never enter the aggregation pipeline). The network.rs / reputation_wiring.rs guards are belt-and-suspenders for any path that bypasses gossip validation (e.g. local injection in tests or future direct calls).
    • The anti-panic policy (unwrap_used, expect_used denied workspace-wide) is not at risk here — the fix uses Err(...) returns.
    • ReputationReject presumably lives in crates/gossip/src/reputation.rs; verify it derives Debug + Display before adding the variant.
    • ADR 008 §14a notes Sybil resistance is deferred, but the minimum-reporter threshold is explicitly in-scope now and this change tightens enforcement without requiring any gossip-aggregation redesign.

    Generated by Agentic Triage for issue #861 · sonnet46 568.4K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. self-assigned this
    on Jun 10, 2026
  4. added 2 commits that reference this issue 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

kind:bugkind:securityprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions