-
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
Missing Expiry in Signature Verification in the UniStaker contracts #233
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
🤖_128_group
AI based duplicate group recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Comments
c4-bot-4
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 |
c4-judge
removed
the
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
label
Mar 14, 2024
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-c
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
labels
Mar 14, 2024
MarioPoneder marked the issue as grade-c |
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
This previously downgraded issue has been upgraded by MarioPoneder |
c4-judge
added
satisfactory
satisfies C4 submission criteria; eligible for awards
and removed
grade-c
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
labels
Mar 17, 2024
MarioPoneder marked the issue as satisfactory |
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
🤖_128_group
AI based duplicate group recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/main/src/UniStaker.sol#L391
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/main/src/UniStaker.sol#L322
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/main/src/UniStaker.sol#L432
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/main/src/UniStaker.sol#L475
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/main/src/UniStaker.sol#L521
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/main/src/UniStaker.sol#L545
https://github.com/code-423n4/2024-02-uniswap-foundation/blob/main/src/UniStaker.sol#L803
Vulnerability details
Impact
The absence of an expiry timestamp in the signature verification process can lead to potential security vulnerabilities. Malicious actors may delay the usage of certain signatures (and the corresponding operations) to their advantages.
Proof of Concept
In the
stakeOnBehalf
function, a signature is used to authorize staking on behalf of another user. However, the signature does not include an expiry timestamp, allowing it to be deliberately delayed:Similar issues can be found in the other mentioned functions.
Tools Used
Manual Analysis
Recommended Mitigation Steps
Introduce an expiry timestamp as part of the data signed by the user. This timestamp should be checked against the current block timestamp to ensure that the signature is still valid at the time of execution. If the signature has expired, the transaction should be reverted.
Modify the data structure for signing to include an expiry timestamp:
Apply similar changes to the other functions that use signatures for authorization.
Assessed type
Access Control
The text was updated successfully, but these errors were encountered: