-
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
The on behalf
functions currently do not include a deadline parameter
#384
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
🤖_116_group
AI based duplicate group recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Comments
c4-bot-7
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 5, 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-b
labels
Mar 14, 2024
MarioPoneder marked the issue as grade-b |
c4-judge
added
grade-c
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
and removed
grade-b
labels
Mar 14, 2024
MarioPoneder marked the issue as grade-c |
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
c4-judge
added
satisfactory
satisfies C4 submission criteria; eligible for awards
and removed
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
🤖_116_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/491c7f63e5799d95a181be4a978b2f074dc219a5/src/UniStaker.sol#L327
Vulnerability details
Bug Description
In the
UniStaker
smart contract, there is astakeOnBehalf
function and other functions that can be called on behalf of a user. If a user wants UNI to be staked for them from another address, they sign a message and pass the generated signature, allowing the other address to call thestakeOnBehalf
function. The issue is that the generated signature is perpetual and can be used at any time.Proof-of-Concept
Alice (EOA) trusts Bob (EOA) and provides a signature for Bob to call the
stakeOnBehalf
function and pre-approve theUniStaker
smart contract. After that, she asks Bob not to send the transaction because she changed her mind.UniStaker.sol#L391-L399
Six months pass, and Bob becomes malicious. Bob can stake on behalf of Alice even after six months because the signature for EOA is not revocable.
Impact
If a user provides a signature allowing someone else to stake on their behalf using the
UniStaker
smart contract but later decides not to stake, there is a risk that the other party could still use that signature to stake on behalf of the user at any time in the future.Tools Used
Manual
Recommended Mitigation Steps
Consider adding a deadline value to
STAKE_TYPEHASH
and other type hashes related toonBehalf
calls:Additionally, ensure that the
block.timestamp
value is less than the current_deadline
.Assessed type
Context
The text was updated successfully, but these errors were encountered: