-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cred.sol#getPositionsForCurator()
reverts when _start > 0
.
#72
Comments
Let me update by Mitigation Steps |
fatherGoose1 marked the issue as satisfactory |
fatherGoose1 marked the issue as selected for report |
Given that this is an external read only function and it's functionality does still work providing the user passes |
Hi @fatherGoose1, I believe this issue should be of QA severity. This function will most likely be used by the UI, so a similar loop functionality on the frontend to retrieve these values from the storage directly could also be used. Overall, since there is no significant impact on the contract level i.e. no other function uses this getter, it should be QA at best. |
There is a solid reason why
|
@kuprumxyz Please state which external system you're talking about here - This getter function will most likely be used by the frontend. Provided the contest README did not mention/provide information about any other external contract systems, a non-existent impact cannot be determined and associated to it. This is of QA-severity at best. You have yourself submitted this as a QA. |
@mcgrathcoutinho I am not the sponsor to comment which is the external system they are using: they know this better. In another finding they commented e.g.
I guess the above comment applies equally to this finding. Taking into account that the sponsor did confirmed the finding, and said "Let me update by Mitigation Steps" it means that they, knowing their external systems, agree with the severity. Unless the sponsor comments to the contrary, this finding is valid. |
@kuprumxyz Why raise this issue when the sponsor has already mentioned it is going to be used on the frontend? Just because a finding is confirmed by the sponsor that does not mean the severity of the issue is a Medium. Let's leave this upto the judge to decide considering we both have brought forth our arguments here. |
Just a side note, but: where in the rules do you see that issues affecting external systems, such as UIs / frontends are QA? Could you please kindly provide me with a link? Suppose the following scenario:
As another example, suppose due to the external view function, which is used nowhere in the contract itself, your frontend (say Metamask) shows an incorrect balance on your ERC-20 account. Is it a serious error? I suppose it is, as you will be either not aware of the funds you have, or try to spend wrong amounts with reverting transactions. |
Sponsor confirmed that this only affects Frontend currently. There are no references to this external function from any other Phi contracts. This is valid QA. |
fatherGoose1 changed the severity to QA (Quality Assurance) |
fatherGoose1 marked the issue as grade-a |
fatherGoose1 marked the issue as not selected for report |
Lines of code
https://github.com/code-423n4/2024-08-phi/blob/main/src/Cred.sol#L513
https://github.com/code-423n4/2024-08-phi/blob/main/src/Cred.sol#L514
Vulnerability details
Impact
This vulnerability causes
reverts
because ofout-of-range
or gives wrong result, and this makes external users or contracts which depends on this function to suffer.Proof of Concept
Cred.sol#getPositionsForCurator()
function is as follows.As we can see above, the length of
credIds
andamounts
created on L505 ~ 506 isstopIndex - start_
.But on L513~514, it used
i
iteratingstart_~stopIndex
as index.This causes
reverts
because ofout-of-range
.Tools Used
Manual Review
Recommended Mitigation Steps
Cred.sol#getPositionsForCurator()
function has to be modified as follows.Assessed type
Error
The text was updated successfully, but these errors were encountered: