Skip to content
Info disclosure Audit finding Intermediate

UserLock information can be found during emergency mode

During the contract's emergency (blocked) mode, the getUserLock function was meant to return empty lock information, but the getUserPastLock function lacked the same emergency check and still exposed the user's lock details. An attacker could therefore read the information the protocol intended to hide.

hubble Follow

Originally disclosed on Code4rena

Submitted by hubble

HolyPaladinToken.sol#L446-L468

When the contract is in blocked state (emergency mode), the protocol wants to return an empty UserLock info, on calling the function getUserLock. However, there is another way, by which the users can find the same information.

The below function is not protected when in emergency mode, and users can use this alternatively. Line#466 function getUserPastLock(address user, uint256 blockNumber)

Impact

There is no loss of funds, however the intention to block information (return empty lock info) is defeated, because not all functions are protected. There is inconsistency in implementing the emergency mode check.

Proof of Concept

Contract Name : HolyPaladinToken.sol Functions getUserLock and getUserPastLock

Recommended Mitigation Steps

Add checking for emergency mode for this function getUserPastLock.

if(emergency) revert EmergencyBlock();

Additional user access check can be added, so that the function returns correct value when the caller(msg.sender) is admin or owner.

Kogaroshi (Paladin) confirmed, resolved, and commented:

Instead of reverting the call, we return an empty Lock (as for getUserLock()). Changes in the PR: PaladinFinance/Paladin-Tokenomics#13


The original report as published on Code4rena, by hubble. 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 emergency-mode check was applied to getUserLock but not to the related getUserPastLock function, so the access restriction was inconsistent.

Impact

No funds were at risk, but the intended blocking of lock information during emergency mode could be bypassed, defeating the protocol's stated intention.

What the attacker needed

Contract in emergency mode

The fix

The function was changed to return an empty Lock during emergency mode, matching getUserLock, and the fix was confirmed and resolved.

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 can have a special 'emergency mode' that switches off certain features. Here the developers wanted one function to return nothing while in that mode, but a second, similar function was left without the same guard, so people could still look up the hidden details through it. It is like locking the front door but leaving a side window open.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by hubble

View all

11 more disclosed reports, best first.

More from Paladin - Warden Pledges contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.