Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Access Control Missing in createMemorabiliaCollection Function

Missing Access Control, Any external address can call this function and arbitrarily create memorabilia collections.

Description

The createMemorabiliaCollection function lacks proper access control. Although the NatSpec comment says it's "only callable by organizer", there is no onlyOrganizer (or equivalent) modifier or internal access logic implemented to enforce this restriction.

// function createMemorabiliaCollection(
string memory name,
string memory baseUri,
uint256 priceInBeat,
uint256 maxSupply,
bool activateNow
) external returns (uint256);//@auddit access control is missing

Risk

Likelihood: H:

  • Reason 1 // The function is external and publicly callable by any address.

  • Reason 2 // There is no modifier or internal check to restrict access.

Impact: H:

  • Impact 1 // Attackers can create unlimited or malicious collections, potentially Damaging the brand or reputation of the projectCausing user confusion or trust loss

  • Impact 2 // Can lead to denial-of-service (DoS) if storage or UI logic depends on filtering through large amounts of bogus data

Proof of Concept

function testAnyoneCanCreateCollection() public {
vm.prank(attacker); // impersonate attacker
memorabilia.createMemorabiliaCollection(
"FakeCollection",
"https://malicious.com/",
1 ether,
1000,
true
);
uint256 id = memorabilia.collectionCount();
assertEq(memorabilia.getCollection(id).name, "FakeCollection");
}

Recommended Mitigation

Consider creating onlyOrgnizer modifier or utilize the Acces control from OpenZeppline.

function createMemorabiliaCollection(
string memory name,
string memory baseUri,
uint256 priceInBeat,
uint256 maxSupply,
bool activateNow
- ) external returns (uint256);
function createMemorabiliaCollection(
string memory name,
string memory baseUri,
uint256 priceInBeat,
uint256 maxSupply,
bool activateNow
+ ) external onlyOrganizer returns (uint256);
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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