Skip to content
Access control Audit finding Beginner

LPToken.set_minter() doesn’t check that _minter doesn’t equal zero

The LPToken contract's set_minter function does not validate that the new minter address is not zero. If called with the zero address, the minter role is permanently lost, preventing any future minter from being set.

pants Follow

Originally disclosed on Code4rena

Submitted by pants

The function LPToken.set_minter() doesn’t check that _minter doesn’t equal zero before it sets it as the new minter.

Impact

This function can be invoked by mistake with the zero address as _minter, causing the system to lose its minter forever, without the option to set a new minter.

Tool Used

Manual code review.

Recommended Mitigation Steps

Check that _minter doesn’t equal zero before setting it as the new minter.

chickenpie347 (Boot Finance) confirmed)

The original report as published on Code4rena, by pants. 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 set_minter is called with the zero address, the system loses its minter forever and cannot set a new minter.

What the attacker needed

None

The fix

The function should be fixed to check that _minter is not the zero address before setting it.

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.

A smart contract has a special role called 'minter' that controls who can create new tokens. The function that changes this role does not check if the new address is the zero address (a special address that no one controls). If someone accidentally sets the minter to the zero address, no one can ever be the minter again, and the token loses that ability permanently.

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 pants

View all

4 more disclosed reports, best first.

More from Boot Finance 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.