# RootBridgeAgent->CheckParamsLib#checkParams does not check that _dParams.token is underlying of _dParams.hToken

checkParams validated hToken and token independently, letting a user deposit cheap USDC but mint high-value hEther on the root chain.

- Payout: Contest reward
- Severity: high
- Program: Maia DAO Ecosystem
- Credited: Emmanuel
- Disclosed: 2023-09-18
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2023-05-maia-findings/issues/687
- Library page: https://bugbountylibrary.com/r/c4%3A2023-05-maia%3AH-09
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** RootBridgeAgent bridgeIn / CheckParamsLib.checkParams cross-chain deposit
**Root cause:** checkParams only verifies that _dParams.token is a registered underlying token (non-zero local token) and that _dParams.hToken is a valid local token, but never checks that the local token of _dParams.token equals _dParams.hToken.
**Steps:**
1. Deploy scenario: RootBridgeAgent on Arbitrum, BranchBridgeAgent on Ethereum with hEther (underlying Ether) and hUSDC (underlying USDC) registered.
2. Alice calls `BranchBridgeAgent#callOutAndBridge` with DepositInput: hToken=hEther, token=USDC, amount=0, deposit=10, toChain=42161.
3. `BranchPort#bridgeOut` pulls 10 USDC from Alice and anyCall fires to RootBridgeAgent.
4. `RootBridgeAgent#bridgeIn` -> `checkParams` passes: amount(0)<=deposit(10), hEther is local token, USDC is valid underlying.
5. `RootPort#bridgeToRoot` mints 10 global hEther to Alice because `_deposit > 0`.
6. Alice now holds 10 hEther (~18000 USDC) for 10 USDC spent.
**How found:** Code review of checkParams: noticed the three checks validate hToken and token independently, and that isUnderlyingToken only tests non-zero mapping rather than equality with hToken.
**Exploitation:** Attacker supplies a cheap depositToken whose underlying is registered while specifying a high-value hToken; the root port mints the high-value hToken equal to the deposit amount, yielding risk-free profit at the protocol's expense.
**Escalation:** Repeatable at scale for any hToken/token pair with mismatched value; drains root-side minting.
**Insight:** When a validation function checks two related fields separately, verify the relationship between them (mapping[token] == hToken), not just that each is individually registered; mismatched-pair bugs in mint/burn bridges are a common high-severity pattern.
