# Blacklist can be completely bypassed on outHere endpoint in mTokenGateway

outHere in mTokenGateway checks blacklist on msg.sender and receiver, but receiver is overwritten by journal _sender, letting blacklisted users withdraw.

- Payout: Audit contest
- Severity: medium
- Program: Malda
- Found by: 0xEkko
- Disclosed: 2025-07-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-07-malda-judging/issues/96
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-07-malda%3AM-4
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:access-control vuln:business-logic

**Target:** mTokenGateway outHere endpoint (cross-chain withdrawal)
**Root cause:** outHere applies ifNotBlacklisted to msg.sender and receiver, but _outHere overwrites receiver with _sender decoded from journalData, and _sender is never blacklist-checked.
**Steps:**
1. Blacklisted user calls `outHere(journalData, seal, amounts, receiver)` from an address in allowedCallers.
2. journalData decodes to _sender = blacklisted user's address.
3. Modifier checks pass on msg.sender (allowed caller) and receiver arg.
4. _outHere overwrites `receiver = _sender`, so funds are sent to the blacklisted user without any blacklist check on _sender.
**How found:** Code reading of outHere modifiers versus _outHere: noticed receiver is reassigned to _sender after the modifier checks, so the blacklist check on receiver is meaningless and _sender is unchecked.
**Exploitation:** A blacklisted user routes the withdrawal through an allowed caller and supplies journalData whose _sender is their own blacklisted address; the receiver overwrite sends the withdrawn amount to them, defeating the blacklist.
**Insight:** When a function validates a parameter in a modifier but an internal callee reassigns that parameter from decoded calldata, the check applies to the wrong value; trace every parameter through internal calls to see if it is overwritten before use.

