diff --git a/src/Gatekeeper.sol b/src/Gatekeeper.sol index e4e7b29..b623685 100644 --- a/src/Gatekeeper.sol +++ b/src/Gatekeeper.sol @@ -137,6 +137,15 @@ contract Gatekeeper is IGatekeeper, Weaver, ReentrancyGuard { bool validSignature = Verifier.verifyGhost(call, px, rx, s); if (!validSignature) revert BadSignature(); + bytes4 selector = bytes4(call[:4]); + if ( + selector != this.recall.selector && + selector != this.rotate.selector && + selector != this.govern.selector + ) { + revert InvalidSelector(); + } + (bool success,) = address(this).call(call); if (!success) revert ExecutionReverted(); diff --git a/src/interfaces/IGatekeeper.sol b/src/interfaces/IGatekeeper.sol index 0fd2487..4a644aa 100644 --- a/src/interfaces/IGatekeeper.sol +++ b/src/interfaces/IGatekeeper.sol @@ -8,6 +8,7 @@ interface IGatekeeper { error BadSignature(); error NotGatekeeper(); error AlreadyExecuted(); + error InvalidSelector(); error InvalidCalldata(); error InvalidPublicKey(); error NonExistentAmount();