Skip to content
Access control Audit finding Beginner

No access control on assignFees() function in NFTXVaultFactoryUpgradeable contract

The assignFees() function in the NFTXVaultFactoryUpgradeable contract lacks access control, allowing any user to call it and update all fees. If the vault owner sets factoryMintFee and factoryRandomRedeemFee to zero, an attacker could change these fees.

ych18 Follow

Originally disclosed on Code4rena

Submitted by ych18

If the Vault owner decides to set factoryMintFee and factoryRandomRedeemFee to zero, any user could call the function NFTXVaultFactoryUpgradeable.assignFees() and hence all the fees are updated.

0xKiwi (NFTX) confirmed and commented:

This function is left over from some upgrades. It will be removed. Thank you.

0xKiwi (NFTX) resolved


The original report as published on Code4rena, by ych18. 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

If the vault owner sets factoryMintFee and factoryRandomRedeemFee to zero, any user could call assignFees() and update all fees, potentially disrupting the fee structure.

What the attacker needed

Vault owner sets factoryMintFee and factoryRandomRedeemFee…

The fix

The function was removed as it was left over from upgrades.

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.

Smart contracts often have functions that change important settings, like fees. If such a function does not check who is calling it, anyone can call it and change those settings. Here, the function that updates fees could be called by any user, potentially allowing them to set fees to whatever they want.

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 ych18

View all

3 more disclosed reports, best first.

More from NFTX 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.