NFT metadata is typically stored off-chain (e.g., on IPFS or via centralized servers), with URIs pointing to those resources. In Snowman.sol
, the complete metadata, including an embedded SVG image or image URI, is base64 encoded and stored directly on-chain via the tokenURI
function.
This behavior leads to permanent storage of potentially sensitive or large data in an immutable public space, increasing gas costs ( a big one), compromising privacy, and hindering upgradeability.
The main concern in terms of sensitivity is the s_SnowmanSvgUri variable, which is:
Stored permanently on-chain as a state variable (set in constructor)
Embedded in every NFT's metadata and base64 encoded
Publicly readable by anyone
Additionally:
SVG Content: If s_SnowmanSvgUri contains a full SVG data URI (like data:image/svg+xml;base64,[encoded-svg]), the entire SVG content becomes permanently stored on-chain in base64 format.
External URLs: If it contains external URLs, those URLs are permanently recorded on-chain, potentially revealing:
Server infrastructure details
API endpoints
Storage locations (IPFS hashes, etc.)
Metadata Permanence: All NFT metadata (name, description, attributes) is permanently stored on-chain in base64 format, making it immutable and publicly accessible forever.
Likelihood:
This will occur every time tokenURI
is called, which happens on any frontend or marketplace metadata lookup.
The s_SnowmanSvgUri
variable is embedded in every NFT's on-chain metadata and is initialized in the constructor with no method for later modification.
Impact:
The SVG image or external resource URI becomes permanently and publicly stored on-chain, exposing infrastructure details or sensitive data if present.
Increased gas cost and contract size from storing full metadata and SVG data on-chain, affecting deployment and minting costs.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.