This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
xiaoming90 - Malicious users can block creators from acknowledging or deacknowledging an edge #273
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
Comments
sherlock-admin3
added
Sponsor Disputed
The sponsor disputed this issue's validity
Won't Fix
The sponsor confirmed this issue will not be fixed
labels
Apr 29, 2024
github-actions
bot
added
Medium
A valid Medium severity issue
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
labels
May 6, 2024
This was referenced May 6, 2024
Closed
Will investigate |
sherlock-admin3
added
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
and removed
Sponsor Disputed
The sponsor disputed this issue's validity
Won't Fix
The sponsor confirmed this issue will not be fixed
labels
May 8, 2024
This was referenced May 12, 2024
Closed
ZdravkoHr. -
TitlesGraph
signatures are replayable because of a compact signature vulnerability
#369
Closed
sherlock-admin2
changed the title
Winning Scarlet Yeti - Malicious users can block creators from acknowledging or deacknowledging an edge
xiaoming90 - Malicious users can block creators from acknowledging or deacknowledging an edge
May 12, 2024
This was referenced May 13, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
xiaoming90
medium
Malicious users can block creators from acknowledging or deacknowledging an edge
Summary
Malicious users can block someone from acknowledging or deacknowledging an edge, affecting the sanctity of the data in the Graph.
Vulnerability Detail
Important
The following is an extract from the contest's README:
The contest's README stated that apart from the loss of assets, the protocol team would like there to be a focus on the sanctity of the data. Thus, any issues related to the sanctity of the data in the Graph would be considered a valid Medium issue in the context of this audit contest, as the Contest's README supersede Sherlock's judging rules per Sherlock's Hierarchy of truth.
Both
acknowledgeEdge
andunacknowledgeEdge
functions rely on the same modifier (checkSignature
) to verify the signature validity. Thus, the signature used for acknowledgment and deacknowledgment of an edge follows the same format and can be used interchangeably. However, this design creates an issue, as described next.Assume that Bob wants to acknowledge an edge. Thus, Bob calls the$Sig_1$ .
acknowledgeEdge
function with his signatureA malicious user can always front-run Bob, take his signature ($Sig_1$ ) and sent to the $Sig_1$ , the signature will be marked as used by the code
unacknowledgeEdge
function instead. When theunacknowledgeEdge
function is executed with_isUsed[keccak256(signature)] = true;
.When Bob's$Sig_1$ ) has already been used.
acknowledgeEdge
transaction gets executed, it will revert because his signature (The malicious users can keep repeating as the chain's gas fees on L2 are cheap.
The same trick can also be used to block someone from deacknowledge an edge.
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/graph/TitlesGraph.sol#L118
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/graph/TitlesGraph.sol#L146
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/graph/TitlesGraph.sol#L40
Impact
Malicious users can block someone from acknowledging or deacknowledging an edge, affecting the sanctity of the data in the Graph.
Code Snippet
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/graph/TitlesGraph.sol#L118
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/graph/TitlesGraph.sol#L146
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/graph/TitlesGraph.sol#L40
Tool used
Manual Review
Recommendation
Consider using two different hash types for acknowledging or deacknowledging within the signature and use a different modifier for checking the signature. This will prevent malicious users from taking the signature intended for
acknowledgeEdge
and submitting it tounacknowledgeEdge
, and vice versa.With this design, if a creator creates a signature intended for
acknowledgeEdge
function, and a malicious user front-runs and copies the signature and submits it toacknowledgeEdge
function, no harm is done as the malicious user is simply executing the task on behalf of the creator. The edge will still be acknowledged at the end.The text was updated successfully, but these errors were encountered: