Skip to content

Security: ClaimRewards — ClaimValidationEnabled default false; sample RNG uses claim-time block hash #1472

Closed @Aphelios01-sdk opened 2026-07-18 03:05 UTC 1 comment Updated 2026-07-18 03:08 UTC

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.go
  • inference-chain/x/inference/types/params.go (ClaimValidationEnabled: false)
  • inference-chain/app/upgrades/v0_2_11/upgrades.go
  • const 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

  1. Re-enable claim validation only after fixing sample entropy
  2. Seed sampling with epoch-fixed material (e.g. settle seed / epoch hash), not claim-time header hash
  3. Or fix must-set at end-of-epoch before claim
  4. 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)

@Aphelios01-sdk commented 2026-07-18 03:07 UTC

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.


🔄 Auto-synced from Issue #1472 every hour.