The protocol is designed to comply with several Ethereum Improvement Proposals (EIPs). Following contracts should be in compliance:
PartyGovernance: Should comply with ERC4906
PartyGovernance: Should comply with ERC165
PartyGovernanceNFT: Should comply with ERC2981
PartyGovernanceNFT: Should comply with ERC721
PartyGovernanceNFT: Should comply with ERC165
ProposalExecutionEngine: Should comply with ERC1271
OffChainSignatureValidator: Should comply with ERC1271
According to this requirement, lack of ERC165 support has been evaluated as Medium risk.
Moreover, during the previous Code4rena contests, similar findings have been evaluated as Medium:
source: https://eips.ethereum.org/EIPS/eip-165
A contract that is compliant with ERC-165 shall implement the following interface (referred as ERC165.sol):
(...)
The interface identifier for this interface is 0x01ffc9a7. You can calculate this by running bytes4(keccak256('supportsInterface(bytes4)')); or using the Selector contract above.
Therefore the implementing contract will have a supportsInterface function that returns:
true when interfaceID is 0x01ffc9a7 (EIP165 interface)
false when interfaceID is 0xffffffff
true for any other interfaceID this contract implements
false for any other interfaceID
Below functions, however, do not return true when interfaceID is 0x01ffc9a7, which implies they do not comply with ERC165.
Lines of code
https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/party/PartyGovernance.sol#L333-L339 https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/party/PartyGovernanceNFT.sol#L113-L120
Vulnerability details
Impact
Protocols that check for compatibility using ERC-165 will receive incorrect value when calling
supportsInterface()
function.The documentation straightforwardly states, that
PartyGovernance
andPartyGovernanceNTF
should comply with ERC1652023-10-party-protocol
According to this requirement, lack of ERC165 support has been evaluated as Medium risk.
Moreover, during the previous Code4rena contests, similar findings have been evaluated as Medium:
Proof of Concept
According to EIP-165:
Below functions, however, do not return true when
interfaceID
is0x01ffc9a7
, which implies they do not comply with ERC165.File: PartyGovernance.sol
File: PartyGovernanceNFT.sol
Tools Used
Manual code review
Recommended Mitigation Steps
Return
true
wheninterfaceId == 0x01ffc9a7
.Assessed type
Other