Beatland Festival

AI First Flight #4
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: high
Likelihood: medium
Invalid

Missing Zero Address Validation in `setOrganizer()` Can Cause Permanent DoS

Root + Impact

Description

  • The `setOrganizer()` function lacks validation to ensure the provided address is not the zero address. If the owner sets `organizer` to `address(0)`, all organizer-only functions (creating performances, configuring passes, creating memorabilia collections) will permanently fail, effectively locking critical contract functionality.

    The normal behavior should validate that the organizer address is a valid non-zero address. However, the current implementation accepts any address including the zero address.

    ```solidity

    function setOrganizer(address _organizer) public onlyOwner {

    organizer = _organizer; // @> No zero address validation

    }

    function createPerformance(...) external onlyOrganizer {

    require(msg.sender == organizer, "Only organizer can call this"); // @> Will fail if organizer is address(0)

    // ...

    }

    ```


Risk

Likelihood:

  • * Owner can call `setOrganizer()` with `address(0)` either accidentally or maliciously

    * No validation prevents setting zero address

    * The function can be called multiple times, but once set to zero, organizer functions are permanently disabled

Impact:

  • * Permanent denial of service for all organizer functions

    * Cannot create performances, configure passes, or create memorabilia collections

    * Contract functionality severely limited

    * No recovery mechanism if owner account is compromised

Proof of Concept

```solidity
// Owner sets organizer to zero address
festivalPass.setOrganizer(address(0));
// All organizer functions fail
organizer.createPerformance(...); // Reverts: "Only organizer can call this"
// msg.sender != address(0) check fails
// Owner can fix it, but if owner is compromised, permanent DoS
```

Recommended Mitigation

```diff
function setOrganizer(address _organizer) public onlyOwner {
+ require(_organizer != address(0), "Invalid organizer address");
organizer = _organizer;
}
```
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge 16 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!