# An attacker is able to hijack any ERC721 / ERC1155 he borrows because guard is missing validation on the address supplied to function call setFallbackHandler()

reNFT's Gnosis Guard failed to validate setFallbackHandler's address, letting a renter point the safe's fallback at the rented NFT contract and transferFrom it to himself.

- Payout: Contest reward
- Severity: high
- Program: reNFT
- Credited: sin1st3r\_\_
- Disclosed: 2024-03-20
- Write-up quality: 8/10
- Original: https://github.com/code-423n4/2024-01-renft-findings/issues/593
- Library page: https://bugbountylibrary.com/r/c4%3A2024-01-renft%3AH-02
- Tags: domain:web3 impact:funds-loss impact:integrity kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:chained technique:source-review vuln:access-control vuln:business-logic

**Target:** Gnosis Safe rental safe Guard policy (setFallbackHandler)
**Root cause:** Guard.sol intercepts a list of dangerous function selectors but does not validate the handler address passed to setFallbackHandler(), so the safe owner can set an arbitrary contract (e.g. the rented token) as fallback handler.
**Steps:**
1. Rent an ERC721/ERC1155 via reNFT so the rental safe holds the token.
2. As safe owner, call `setFallbackHandler(address(rentedToken))` on the safe; Guard permits it.
3. Call `transferFrom(safeAddress, attackerAddress, tokenId)` on the safe.
4. Safe lacks transferFrom, forwards calldata to fallback handler = token contract.
5. Token contract sees msg.sender = safe (owner) and transfers token to attacker.
**How found:** Reading Guard.sol's selector blocklist and noticing setFallbackHandler was checked for the selector but not for the handler address argument, then reasoning about Gnosis Safe fallback dispatch forwarding unknown calldata to the handler.
**Exploitation:** Attacker rents a victim's NFT, sets the rented token contract as the safe's fallback handler, then invokes transferFrom on the safe; the safe forwards the call to the token contract which executes the transfer as the owner, sending the NFT to the attacker. Lender loses the asset and rental payment.
**Insight:** When auditing guard/hook allowlists that block function selectors, check whether the arguments of allowed-but-sensitive functions (like setFallbackHandler, delegatecall targets, module addresses) are validated — an unvalidated address arg turns the safe itself into the attacker's proxy.
