Skip to content
Access control Audit finding Intermediate

BasePool.mint() Is Callable By Anyone

The BasePool.mint() function lacks an onlyRouter modifier, allowing anyone to call it directly and bypass the input validation performed by VaderRouter.addLiquidity(). An attacker could mint pool tokens without going through the router's checks.

leastwood Follow

Originally disclosed on Code4rena

Submitted by leastwood

Impact

The BasePool.mint() function differs from its implementation in BasePoolV2.mint() in which it lacks an onlyRouter modifier. This ensures that users cannot call this function directly as VaderRouter.addLiquidity() performs some necessary input validation which can be bypassed by directly calling BasePool.mint().

Proof of Concept

Tools Used

Manual code review.

Recommended Mitigation Steps

Consider adding an onlyRouter modifier to the BasePool.mint() function to ensure users cannot directly call this function.

SamSteinGG (Vader) disputed:

The pool contracts, similarly to Uniswap V2, are never meant to be interacted with directly.

alcueca (judge) commented:

That’s what the modifier would do.

SamSteinGG (Vader) commented:

They are never meant however it should still be possible to do so. With Uniswap V2, it is possible to interact with the contracts directly however doing so (without using a smart contract) will result in the same vulnerabilities as described in the issue. This is not intended usage and as such does not constitute an issue unless it is implied that the Uniswap V2 implementation is incorrect.

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

Root cause

Likely the missing onlyRouter modifier on BasePool.mint() allows direct calls that bypass router-level input validation.

Impact

An attacker could call mint() directly, bypassing the router's input validation, though the project argues this is not an issue because direct interaction is not intended usage.

What the attacker needed

None

The fix

The report recommends adding an onlyRouter modifier to BasePool.mint(), but the project disputed this and no fix was confirmed.

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 function that is supposed to be called only by another contract (the router), which checks the inputs. Because the function is public, anyone can call it directly and skip those checks. This could let someone create pool tokens without proper validation.

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 leastwood

View all

70 more disclosed reports, best first.

More from Vader Protocol 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.