Skip to content
Access control Audit finding Intermediate

Extensive permissions for owner

The smart contract owner had unchecked privileges to mint unlimited tokens, change vesting schedules, and alter plot rarity. An attacker with owner access could mint beyond the cap, make vested tokens unvested, or devalue NFTs by changing rarity.

Lambda Follow

Originally disclosed on Code4rena

Submitted by Lambda

contracts/RuniverseLandMinter.sol#L358 contracts/RuniverseLand.sol#L195 contracts/RuniverseLandMinter.sol#L513

Some privileged functions are often unavoidable in smart contracts. However, in these contracts, the privileges are (unnecessarily) very extensive and without checks on the smart contract side:

  1. He can use ownerMint (or ownerMintUsingTokenId) to mint an arbitrary number of tokens. While these functions should be used for private minting, there is nothing restricting the owner from minting more than 10,924 plots and using the function later on to mint additional plots.
  2. He can use setVestingStart / setVestingEnd / setLastVestingGlobalId to change the vesting configuration at any point. This can cause already vested tokens to suddenly become unvested (and therefore untransferable). Furthermore, there is no restriction on the parameters, so an owner could for instance set a vesting end that is 100 years in the future.
  3. He can change the plots that are available per size at any time with setPlotsAvailablePerSize. Therefore, a user might think that he buys a rare plot size, but the plot size becomes very common afterwards, destroying the value of his NFT.

Therefore, the user currently has to trust the owner that he does not perform any of the previously described actions.

Recommended Mitigation Steps

  1. Only allow the owner to mint up to 10,924 plots and only allow it before the other phases have started (mintlist / claimlist / public sale).
  2. Remove these functions, these should be immutable parameters such that a user can be sure that his vesting date never changes.
  3. Remove this function, this should be immutable such that the rarities of NFTs cannot be changed arbitarily.

Alex the Entreprenerd (judge) commented:

After further talking with other Judges, I believe the finding to be valid and of Medium Severity.

While the fact that the admin has certain privileges is OOS.

The fact that:

  • Minting can go over the cap (unchecked minting / broken invariant)
  • Rarity could be changed indirectly (broken invariant)

Is worth noting.

For these reasons, am assigning a Medium Severity.

msclecram (Forgotten Runiverse) confirmed and commented:

We updated the code with the next changes:

  • Vesting assert for starting time
  • OwnerMint assert to avoid minting more than plots available per size
  • We removed SetPlotsAvailablePerSize

https://github.com/bisonic-official/plot-contract/commit/ea8abd7faffde4218232e22ba5d8402e37d96878


The original report as published on Code4rena, by Lambda. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

The owner could mint more than the intended cap, change vesting so tokens become untransferable, or alter plot rarity, potentially destroying NFT value; users must trust the owner not to do so.

What the attacker needed

Owner privileges

The fix

The code was updated to add vesting and ownerMint assertions and to remove setPlotsAvailablePerSize.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In a smart contract, the owner is a special account that can call certain functions. Here, the owner could do things like create unlimited tokens or change rules after people bought NFTs, which could harm users. The report says these powers should be limited or removed.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Lambda

View all

64 more disclosed reports, best first.

More from Forgotten Runiverse - Versus contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.