This report details a security vulnerability in the EggstravaganzaNFT contract's authorization pattern, which could potentially allow unauthorized NFT minting through manipulation of the game contract address. The severity of this vulnerability varies depending on the deployment context, with decentralized deployments facing higher risk due to the potential for token dilution and loss of control.
The vulnerability exists in the setGameContract
function and its interaction with the mintEgg
function
The vulnerability stems from two primary issues:
The setGameContract
function allows any address to be set as the game contract without proper validation or security controls
The mintEgg
function trusts the game contract implicitly, allowing it to mint unlimited NFTs without restrictions
The impact varies significantly based on deployment context:
Decentralized Deployment (High Risk):
Potential for unlimited NFT minting
Risk of token dilution
Loss of control over token supply
Financial impact through value manipulation
Centralized Deployment (Medium Risk):
Governance risk through key compromise
Potential for unauthorized minting
Limited by centralized trust model
Foundry for testing and verification
Solidity compiler for contract analysis
Static analysis tools for vulnerability identification
The vulnerability can be demonstrated through the following sequence:
An attacker gains control of the owner key
The attacker calls setGameContract
with a malicious contract address
The malicious contract repeatedly calls mintEgg
to create unlimited NFTs
The total supply increases without restriction
Based on deployment context, implement one of the following solutions:
For Centralized Deployments:
For Decentralized Deployments:
The recommended mitigation approach depends on your deployment context:
For centralized deployments, implement the two-step proposal pattern with timelock
For decentralized deployments, implement the multi-signature governance pattern
Consider implementing both patterns for maximum security in hybrid deployments
Owner is trusted and is not expected to interact in ways that would compromise security
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.