Use of _mint in ReraiseETHCrowdfund#_contribute is incompatible with PartyGovernanceNFT#mint
The crowdfund contract mints a soulbound NFT to a contributor using a plain mint, while the party governance contract later uses a safe mint that requires the recipient to implement the ERC721 receiver interface. If a contract without that interface contributes, it receives the crowdfund NFT but can never claim the party NFT, potentially locking the party's voting power.
Submitted by 0x52
Misconfigured receiver could accidentally DOS party.
Proof of Concept
if (previousVotingPower == 0) _mint(contributor); <- @audit-issue standard minting here
uint256 tokenId = party.mint(contributor, votingPowerByCard[i], delegate); <- @audit-issue uses party.mint
_safeMint(owner, tokenId); <- @audit-issue PartyGovernanceNFT#mint utilizes _safeMint
The issue at hand is that ReraiseETHCrowdfund#_contribute and PartyGovernanceNFT#mint use inconsistent minting methods. PartyGovernanceNFT uses safeMint whereas ReraiseETHCrowdfund uses the standard mint. This is problematic because this means that a contract that doesn’t implement ERC721Receiver can receive a CrowdfundNFT but they can never claim because safeMint will always revert. This can cause a party to be inadvertently DOS’d because CrowdfundNFTs are soul bound and can’t be transferred.
Recommended Mitigation Steps
Use _safeMint instead of _mint for ReraiseETHCrowdfund#_contribute
0xble (Party) confirmed and commented:
I think a better mitigation would be to allow the user to specify a
receiveraddress that can receive the party NFT when claiming, so if they cannot claim themselves they can specify another address that should receive it instead. It works similarly inCrowdfund, used to implement prior crowdfunds.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the crowdfund contract uses a plain mint instead of a safe mint, so it does not verify that the recipient can handle ERC721 tokens, while the party contract uses a safe mint that does verify.
Impact
A party could be inadvertently denied service because the contributor's voting power becomes permanently locked in a soulbound token that cannot be claimed or transferred.
What the attacker needed
Contributor is a contract; contract lacks ERC721Receiver; contract contributes to crowdfund
The fix
The crowdfund contract should use a safe mint, or allow the contributor to specify a receiver address when claiming so the party NFT can be sent to an address that can handle it.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a contract receives an NFT, the NFT contract can check that the receiver knows how to handle NFTs by calling a special function. One part of this system skips that check, so a contract can end up holding a non-transferable token. Later, another part does the check and refuses to mint, leaving the tokens stuck.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.