Open howlbot-integration[bot] opened 2 months ago
This is a good observation. I appreciate it.
fatherGoose1 marked the issue as satisfactory
fatherGoose1 marked the issue as selected for report
Hi @fatherGoose1,
Could you please re-consider this issue and its dups for High-severity? It seems like the impact is rather suited as a high-severity bug since the protocol would be losing all the fees and royalties from all the PhiNFT1155.sol instances ever created as well as considering that the accumulated amount would become large over time.
Thank you for your time!
Hi,
This has been correctly identified as a Medium severity issue. The preconditions are very unlikely - project changing their protocolFeeDestination address is extremely unlikely. Low likelihood + High impact = Medium severity.
Thanks!
Hey @bronzepickaxe,
C4 has their own severity categorization rules when estimating risk. Please do not use different severity categorization rules here that are used outside of C4.
Acc to the High-severity definition, if assets can be lost or compromised, it is to be treated as a high-severity issue.
3 — High: Assets can be stolen/lost/compromised directly (or indirectly if there is a valid attack path that does not have hand-wavy hypotheticals).
My first comment was directed towards the judge, so please refrain from trying to negate my comments and let the judge make up their mind. Thank you!
I agree that this issue has high impact, but requires that the fee destination address be changed, which is rather unlikely in practice. Even in the case of a fee address update, the older fee address may still be functional and the desired location for the older fee accrual. Sticking with medium for these reasons.
Lines of code
https://github.com/code-423n4/2024-08-phi/blob/8c0985f7a10b231f916a51af5d506dd6b0c54120/src/art/PhiNFT1155.sol#L122
Vulnerability details
Summary
Context: When a PhiNFT1155.sol contract instance is created from the PhiFactory contract, the initialize() function is called to setup it. One of the parameters passed along is the protocolFeeDestination address, which is used as the default royalty recipient (see here) and the address that will receive the artCreate fees (see here).
Issue: The issue is that if the protocolFeeDestinationAddress contract is changed in the PhiFactory contract by the owner using function setProtocolFeeDestination(), the existing PhiNFT1155.sol contract instances created would still be using the old protocol fee destination address stored in them since it is not being dynamically retrieved from the PhiFactory contract. The protocolFeeDestination address could be updated for several reasons such as in case it is compromised, becomes malicious or there has been a decision made to make the address non-privileged.
Impact: Due to this, the old protocol fee destination address would still be receiving all the royalties (i.e. 500 bps = 5%) from all PhiNFT1155.sol contract instances. It would also be receiving all the artCreateFee amount of tokens when art is created through the createArtFromFactory() function.
Proof of Concept
Tools Used
Manual Review Review
Recommended Mitigation Steps
To solve the issue in CreatorRoyaltiesControl, consider retrieving the default royalty recipient variable dynamically from the phiFactory contract. The same would also need to be applied to the protocolFeeDestination address currently stored in the PhiNFT1155.sol contract.
Using dynamic retrieval from the factory would solve the issue for all PhiNFT1155.sol contract instances that were created.
Assessed type
Error