The set_secret
function should enforce reasonable size limits on secret data to prevent abuse, state bloat, and excessive gas costs while still accommodating legitimate use cases.
The set_secret
function accepts vector<u8>
input of any size without validation, allowing users to store arbitrarily large data on-chain. This enables state bloat attacks where malicious actors can consume excessive blockchain storage, increase gas costs for all users, and potentially cause network congestion.
Likelihood:
Easy to exploit - just provide large input data
No technical barriers prevent abuse
Economic incentive may limit some attacks (gas costs)
Could be used by legitimate users accidentally
Impact:
State bloat: Large secrets consume permanent blockchain storage
High gas costs: Users pay excessive fees for large data storage
Network congestion: Large transactions slow down block processing
Economic griefing: Attackers can force high storage costs on users
Resource exhaustion: Unlimited storage per user scales poorly
The following test demonstrates the unbounded size vulnerability:
Add size validation with reasonable limits:
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.