-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UniStaker contract uses signature that do not have expiration #231
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-205
grade-b
🤖_128_group
AI based duplicate group recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Comments
c4-bot-6
added
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
labels
Mar 4, 2024
MarioPoneder marked the issue as duplicate of #69 |
MarioPoneder marked the issue as not a duplicate |
MarioPoneder marked the issue as duplicate of #205 |
MarioPoneder changed the severity to QA (Quality Assurance) |
c4-judge
added
downgraded by judge
Judge downgraded the risk level of this issue
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
grade-b
and removed
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
labels
Mar 14, 2024
MarioPoneder marked the issue as grade-b |
This previously downgraded issue has been upgraded by MarioPoneder |
c4-judge
added
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
and removed
downgraded by judge
Judge downgraded the risk level of this issue
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
labels
Mar 17, 2024
MarioPoneder marked the issue as satisfactory |
c4-judge
added
the
satisfactory
satisfies C4 submission criteria; eligible for awards
label
Mar 17, 2024
CloudEllie
added
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
and removed
satisfactory
satisfies C4 submission criteria; eligible for awards
labels
Mar 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-205
grade-b
🤖_128_group
AI based duplicate group recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/uniswapfoundation/UniStaker/blob/d745dd2a393f4b6a35bca2fd72f4cd198840c081/src/UniStaker.sol#L324
Vulnerability details
Impact
When a user creates a signature operation for the
UniStaker
contract there is no any expiration time for this operation. That means that once, the signer has signed the signature for the user it can use it for the end of life.Proof of Concept
All
UniStaker
method that use signatures do not make use of an expiration parameterhttps://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
like is done in
UNI
token implementation in the methods delegateBySig or permit:Tools Used
Manual review
Recommended Mitigation Steps
Add expiration parameter to the signature and the function using the signatures. Do not forget to also make use of the expiration parameter like in this example :
for example here is a sample implementation for the
UniStaker#withdrawOnBehalf
method:Assessed type
Other
The text was updated successfully, but these errors were encountered: