# InfernalRiftBelow.claimRoyalties no verification msg.sender

InfernalRiftBelow.claimRoyalties trusted msg.sender's xDomainMessageSender() without checking the caller was the real L2 messenger, letting anyone spoof it and steal bridged NFTs.

- Payout: Audit contest
- Severity: high
- Program: Flayer
- Found by: Ironsidesec
- Disclosed: 2024-08-06
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2024-08-flayer-judging/issues/406
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-flayer%3AH-13
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:access-control vuln:auth-bypass

**Target:** InfernalRiftBelow L2 cross-chain claimRoyalties handler
**Root cause:** claimRoyalties authenticates the cross-chain sender by calling ICrossDomainMessenger(msg.sender).xDomainMessageSender() but never verifies msg.sender is the legitimate L2_CROSS_DOMAIN_MESSENGER, so any contract implementing that interface can return INFERNAL_RIFT_ABOVE.
**Steps:**
1. Deploy attacker contract implementing ICrossDomainMessenger with xDomainMessageSender() returning INFERNAL_RIFT_ABOVE
2. Call InfernalRiftBelow.claimRoyalties(_collectionAddress, attackerRecipient, _tokens) from that contract
3. Pass the msg.sender check since xDomainMessageSender() returns the trusted rift address
4. InfernalRiftBelow forwards to ERC721Bridgable.claimRoyalties, transferring the NFTs to attackerRecipient
**How found:** Code review of the cross-chain authentication pattern: noticed the check relies solely on the caller-supplied xDomainMessageSender() return value without confirming msg.sender equals the trusted L2 messenger, making the check spoofable by any deployed contract.
**Exploitation:** Attacker deploys a fake messenger contract whose xDomainMessageSender() returns INFERNAL_RIFT_ABOVE, then invokes claimRoyalties with a collection, attacker-controlled recipient, and target token IDs; the unauthenticated call reaches ERC721Bridgable.claimRoyalties and transfers the NFTs out to the attacker.
**Insight:** When a contract authenticates cross-chain messages via xDomainMessageSender(), always also assert msg.sender == the canonical messenger address; the interface call alone is attacker-controllable because any contract can implement it.

