Security: ClaimRewards — ClaimValidationEnabled default false; sample RNG uses claim-time block hash #1472
Summary
Two related issues in MsgClaimRewards integrity:
A) ClaimValidationEnabled defaults to false (also forced false in upgrade v0.2.11)
When false, validateClaim (seed check + missed-validation statistical test) is skipped; handler goes straight to payoutClaim after basic settle checks.
B) When validation is enabled, must-validate membership uses reservoir sampling (max 10000) seeded by claim-time ctx.HeaderInfo().Hash
ShouldValidate(msg.Seed, …) is deterministic from the settled seed (good), but which inferences are checked can be influenced by when the claimant submits (grind block hashes) if filteredCount > 10000.
Affected
inference-chain/x/inference/keeper/msg_server_claim_rewards.goinference-chain/x/inference/types/params.go(ClaimValidationEnabled: false)inference-chain/app/upgrades/v0_2_11/upgrades.goconst maxInferenceSampleSize = 10000
Relevant source
if params.ValidationParams != nil && params.ValidationParams.ClaimValidationEnabled {
// validateClaim ...
}
// else: skip duty enforcement
payoutClaim(...)
blockHash := ctx.HeaderInfo().Hash
blockHashSeed := int64(binary.BigEndian.Uint64(blockHash[:8]))
rng := rand.New(rand.NewSource(blockHashSeed))
// reservoir sample then ShouldValidate(msg.Seed, ...)
Impact
- Flag off: hosts can claim work/reward coins without on-chain validation-duty enforcement
- Flag on + high volume: sample grinding may reduce detected misses
Suggested remediation
- Re-enable claim validation only after fixing sample entropy
- Seed sampling with epoch-fixed material (e.g. settle seed / epoch hash), not claim-time header hash
- Or fix must-set at end-of-epoch before claim
- Tests: claim block hash must not change must-validate set for same settle state
Disclosure
Static analysis + local logic proofs only. Prefer HackerOne if public issues are out of process.
💬 Comments (1)
🔄 Auto-synced from Issue #1472 every hour.
Closing to focus disclosure on the highest-priority finding: https://github.com/gonka-ai/gonka/issues/1470 (SSRF via InferenceUrl). Other items can be re-opened or filed via HackerOne if needed.