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.
Summary
prediction_market/src/lib.rsset_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
place_betXLM deposits to a malicious token contract that absorbs funds and never credits outcomes.Fix
set_config.ConfigChangedevent with old/new addresses.