UniStaker Infrastructure - imare's results

Staking infrastructure to empower Uniswap Governance.

General Information

Platform: Code4rena

Start Date: 23/02/2024

Pot Size: $92,000 USDC

Total HM: 0

Participants: 47

Period: 10 days

Judge: 0xTheC0der

Id: 336

League: ETH

Uniswap Foundation

Findings Distribution

Researcher Performance

Rank: 16/47

Findings: 1

Award: $694.30

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

694.2987 USDC - $694.30

Labels

bug
downgraded by judge
grade-b
QA (Quality Assurance)
edited-by-warden
:robot:_128_group
duplicate-206
Q-19

External Links

Lines of code

https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5a2761c8277541a24bc551fbd624413b384bea94/src/UniStaker.sol#L315

Vulnerability details

Impact

If a user decides that a signature for a UniStaker operation is not to be used anymore there is no implementation that provides this functionality of invalidating a valid signature. Making such signature operation valid forever until a signature transaction is consumed.

Proof of Concept

If the user decides to rescind a provided signature he/she is unable to do so.

A user signature operation on UniStaker contract can be currently "invalidated" only if consumed in a transaction.

The user creating a signature should be able to invalidate an existing signature by invalidate/increment the user nonce which is used on the signature verification.

In the UniStaker contract there are many methods that use signatures to carry operation in the name of the user which created the specific operation signature:

https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5a2761c8277541a24bc551fbd624413b384bea94/src/UniStaker.sol#L315 https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5a2761c8277541a24bc551fbd624413b384bea94/src/UniStaker.sol#L382 https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5a2761c8277541a24bc551fbd624413b384bea94/src/UniStaker.sol#L423 https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5a2761c8277541a24bc551fbd624413b384bea94/src/UniStaker.sol#L466 https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5a2761c8277541a24bc551fbd624413b384bea94/src/UniStaker.sol#L512 https://github.com/code-423n4/2024-02-uniswap-foundation/blob/5a2761c8277541a24bc551fbd624413b384bea94/src/UniStaker.sol#L544

But there is no implementation that provides the ability for the same user to rescind the signature and decide to block its execution.

Tools Used

Manual review

Add a method to UniStaker.sol contract file where the user can invalidated its nonce and in doing so block all created and not already consumed signatures:

contract UniStaker is INotifiableRewardReceiver, Multicall, EIP712, Nonces {
    ...
+   function invalidateNonce() external {
+        _useNonce(msg.sender);    
+   }
    ...

Assessed type

Other

#0 - c4-judge

2024-03-07T17:00:26Z

MarioPoneder marked the issue as duplicate of #69

#1 - c4-judge

2024-03-07T23:13:08Z

MarioPoneder marked the issue as duplicate of #206

#2 - c4-judge

2024-03-14T03:36:27Z

MarioPoneder changed the severity to QA (Quality Assurance)

#3 - c4-judge

2024-03-14T13:48:13Z

MarioPoneder marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter