Skip to content
Business logic Audit finding Beginner

Missing whenNotPaused

The LensHub contract's transfer function lacks the whenNotPaused modifier that other external functions have, so governance cannot stop profile NFT transfers during an emergency. An attacker could continue transferring profile NFTs even when the protocol is paused.

danb Follow

Originally disclosed on Code4rena

Submitted by danb

LensHub.sol#L929

All the external function of LensHub have whenNotPasued modifier. However, LensHub is erc721 and the transfer function doesn’t have the whenNotPaused modifier.

Impact

In case where the governance wants to stop all activity, they still can’t stop transferring profiles nfts. An example where stopping transferring tokens was actually very helpful: https://mobile.twitter.com/flashfish0x/status/1466369783016869892.

Recommended Mitigation Steps

Add whenNotPasued to _beforeTokenTransfer.

Zer0dot (Aave Lens) confirmed, resolved, and commented:

Nice! Addressed in aave/lens-protocol#75.


The original report as published on Code4rena, by danb. 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 _beforeTokenTransfer hook was not updated to include the whenNotPaused modifier, leaving transfers exempt from the pause.

Impact

Governance could not stop profile NFT transfers during a pause, potentially allowing unwanted activity to continue.

What the attacker needed

Governance pauses the contract; attacker holds a profile NFT

The fix

The issue was fixed by adding the whenNotPaused modifier to the _beforeTokenTransfer hook.

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 pause switch is meant to stop all activity in an emergency. Here, one action (transferring profile NFTs) still worked even when the switch was on. This means the team could not fully freeze the system when needed.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by danb

View all

12 more disclosed reports, best first.

More from Aave Lens contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.