fix: SafeCallFilter XCM Transact vulnerability (Immunefi #81386)#3798
fix: SafeCallFilter XCM Transact vulnerability (Immunefi #81386)#3798ouwibo wants to merge 1 commit into
Conversation
Fixes SafeCallFilter that unconditionally accepted ALL runtime calls
via XCM Transact, bypassing security controls.
Vulnerable code (all 3 runtimes):
fn contains(_call: &RuntimeCall) -> bool {
// TODO review
true // ← accepts everything
}
Fixed to whitelist only safe operations:
- Balances (transfers)
- Ethereum/EVM (cross-chain DeFi)
- Utility (batch calls)
Blocks privileged calls: governance, system.setCode, etc.
Immunefi submission: https://bugs.immunefi.com/dashboard/submission/81386
Affected: moonbeam, moonriver, moonbase runtimes
Co-authored-by: Claude Code (Anthropic)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR restricts XCM call safety filtering across three Moonbeam runtime configurations. The ChangesXCM SafeCallFilter Security Restriction
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hey @ouwibo thanks for the report! At a first glance I'd say that Heads up that Polkadot's AssetHub uses this filter: |
Security Fix: SafeCallFilter XCM Transact Vulnerability
Immunefi Submission: https://bugs.immunefi.com/dashboard/submission/81386
Problem
The
SafeCallFilterin all three runtimes (Moonbeam, Moonriver, Moonbase) unconditionally returnstruefor ALL runtime calls, completely bypassing XCM Transact security controls.Impact
An attacker with XCM access can execute ANY runtime call including:
balances.transfer- Direct fund theftgovernance.*- Governance manipulationsystem.setCode- Chain state modificationethereum.transact- Arbitrary EVM executionSeverity: Critical (Immunefi classification)
Fix
Implement proper call filtering that whitelists only safe operations:
Affected Files
runtime/moonbeam/src/xcm_config.rs(line 202)runtime/moonriver/src/xcm_config.rs(line 210)runtime/moonbase/src/xcm_config.rs(line 221)Testing
This PR addresses a security vulnerability reported via Immunefi.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.