Skip to content

Bridge-Hubs: Add proxy pallet#1045

Merged
bkchr merged 4 commits into
mainfrom
bkchr-bridge-proxy
Jan 10, 2026
Merged

Bridge-Hubs: Add proxy pallet#1045
bkchr merged 4 commits into
mainfrom
bkchr-bridge-proxy

Conversation

@bkchr

@bkchr bkchr commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 runtime-security issues in the new ProxyType call filtering (restrictions can be bypassed / allow transfers) and 2 correctness issues in generated weight files (benchmarked against coretime runtimes, not bridge-hub runtimes).

Comment on lines +569 to +611
impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => matches!(
c,
RuntimeCall::System(_) |
RuntimeCall::ParachainSystem(_) |
RuntimeCall::Timestamp(_) |
RuntimeCall::CollatorSelection(_) |
RuntimeCall::Session(_) |
RuntimeCall::Utility(_) |
RuntimeCall::Multisig(_) |
RuntimeCall::Proxy(_) |
RuntimeCall::BridgeRelayers(pallet_bridge_relayers::Call::register { .. }) |
RuntimeCall::BridgeRelayers(pallet_bridge_relayers::Call::deregister { .. }) |
RuntimeCall::BridgeRelayers(pallet_bridge_relayers::Call::claim_rewards { .. })
),
ProxyType::CancelProxy => matches!(
c,
RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
ProxyType::Collator => matches!(
c,
RuntimeCall::CollatorSelection { .. } |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
}
}

fn is_superset(&self, o: &Self) -> bool {
match (self, o) {
(x, y) if x == y => true,
(ProxyType::Any, _) => true,
(_, ProxyType::Any) => false,
(ProxyType::NonTransfer, ProxyType::Collator) => true,
_ => false,
}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProxyType::NonTransfer allows RuntimeCall::Utility(_) and RuntimeCall::Multisig(_) ([Line 580-586]). Both pallets can dispatch arbitrary inner calls (e.g., utility::batch{,_all} wrapping balances::transfer, and multisig executing any call), which effectively bypasses the 'non-transfer' restriction and turns this proxy into an Any proxy. Fix by either (a) removing Utility and Multisig from NonTransfer, or (b) implementing a recursive filter that inspects inner calls and rejects any that transfer funds/assets (and similarly handles nested proxy/batch).

Comment thread system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Comment thread system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Comment thread system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs
Comment thread system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Comment thread system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs

@clangenb clangenb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, but looks good otherwise. I have cross-checked:

  • Proxy deposits with other chains ✅
  • Proxy type rights with other chains ✅

Comment thread system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Comment thread system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
@bkchr bkchr enabled auto-merge (squash) January 9, 2026 22:43
@bkchr bkchr merged commit 69ebda6 into main Jan 10, 2026
62 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants