Skip to content

[CRITICAL] set_config can re-point market to malicious contracts — total fund theft #173

Description

@grantfox-oss

Summary

prediction_market/src/lib.rs set_config (lines ~375-420) allows the governor to replace the token, referral, leaderboard, and XLM Sac contract addresses without any validation. There is no allowlist check, no code-hash pinning, and no event emission for config changes.

Impact

  • A compromised or malicious governor can redirect all place_bet XLM deposits to a malicious token contract that absorbs funds and never credits outcomes.
  • A malicious referral registry can intercept 100% of referral fees.
  • A malicious leaderboard can inflate rewards to arbitrary addresses.
  • No off-chain monitoring is possible — no event is emitted when the config changes.

Fix

  • Pin WASM hashes for all dependency contracts and verify on set_config.
  • Require a timelock (7+ days) between config request and approval.
  • Emit a ConfigChanged event with old/new addresses.
  • Maintain an allowlist of approved dependency deployments.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSThird CampaignCampaign: Third CampaigncriticalCritical severity - funds at riskprediction-marketPrediction market contractsecuritySecurity vulnerability

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions