# Whitelists

Many protocols today implement whitelists for regulatory compliance, here are some common pitfalls and vulnerabilities with such patterns.

## Edge Cases & Exploit Vectors

* Any whitelisted address can use EIP 7702 to set their own account code that allows non-whitelsited accounts to interact with the protocol

Consider the following scenario:

* Assume protocol has a whitelist mapping, where only users who are whitelisted can call function A
* Bob is whitelisted for his address 0xFF
* Bob uses 7702 to set his 0xFF account code to:

```solidity
contract {
     address victimSystem;
    
     function callThis(...) external {
           victimSystem.whitelistedFunction(...);
     }
}
```

* Now anyone can call the whitelisted function through calling callThis on 0xFF

## Checklist Items

* Did you check if EIP 7702 could be used to bypass the whitelist?

## Audit References & Resources

* M0 Uniswap V4 hook review, L-07: [Pectra Upgrade Enables EOAs](https://github.com/GuardianAudits/Audits/blob/main/M0/M0_Uniswap_V4_Hooks_report.pdf)
* Bracket Wrapped Vault Review: M-01: \[TODO]


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lab.guardianaudits.com/encyclopedia-of-security-research/whitelists.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
