You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reputation: self-reports are accepted — reporter == provider fills one of the three distinct-reporter slots and self-boosts the network score #861
kind:bugSomething does not behave as documentedkind:securitySecurity impact; report a vulnerability to [email protected], not hereprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
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:
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.
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.
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
crates/gossip/src/reputation.rsvalidate_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.rsrecord (~line 284): Guard distinct_reporters.insert(report.reporter) to skip (or return early) when report.reporter == report.provider
crates/node/src/reputation_wiring.rsNodeReputationSink::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.
kind:bugSomething does not behave as documentedkind:securitySecurity impact; report a vulnerability to [email protected], not hereprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Activity
github-actions commentedon Jun 10, 2026
🎯 Triage report
A staked node can sign and gossip a
ReputationReportwherereporter == provider, bypassing the ADR 008 distinct-reporter threshold (counts itself as one of three required external reporters) and self-boosting its ownnetwork_scoreat 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
bug,security,medium,rust)🔗 Similar issues
total_settled_value; different attack surface (reporter weight, not distinct-reporter threshold), same security domain💡 Notes and suggestions
Fix checklist
crates/gossip/src/reputation.rsvalidate_reputation_envelope(~line 134–194): Addif body.reporter == body.provider { return Err(ReputationReject::SelfReport); }— addSelfReportvariant toReputationReject, increment areputation_self_report_rejected_totalcounter for observabilitycrates/reputation/src/network.rsrecord(~line 284): Guarddistinct_reporters.insert(report.reporter)to skip (orreturnearly) whenreport.reporter == report.providercrates/node/src/reputation_wiring.rsNodeReputationSink::accept(~line 315–361): Add the samereporter == providerguard, consistent with the gossip-layer rejectiontest_self_report_rejectedingossip/src/reputation.rs;test_self_report_not_counted_distinctinreputation/src/network.rsImplementation notes
network.rs/reputation_wiring.rsguards are belt-and-suspenders for any path that bypasses gossip validation (e.g. local injection in tests or future direct calls).unwrap_used,expect_useddenied workspace-wide) is not at risk here — the fix usesErr(...)returns.ReputationRejectpresumably lives incrates/gossip/src/reputation.rs; verify it derivesDebug+Displaybefore adding the variant.Add this agentic workflows to your repo
To install this agentic workflow, run
fix(reputation): reject reporter == provider self-reports (#861)
Merge pull request #865 from decdn/fix/quick-win-medium-batch
fix: batch of six quick-win MEDIUM bug fixes (#865)