Skip to content
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

Owner can prevent from draw running the second time #195

Open
code423n4 opened this issue Dec 16, 2022 · 7 comments
Open

Owner can prevent from draw running the second time #195

code423n4 opened this issue Dec 16, 2022 · 7 comments
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue grade-b Q-14 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax satisfactory satisfies C4 submission criteria; eligible for awards sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L203

Vulnerability details

Impact

The owner can decide not to redraw. Therefore if no winner is selected the first time, the owner can wait for the lock period to end and get their NFT back.

Proof of Concept

redraw function is set with the onlyOwner modifier. It can only be called by the owner.
https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L203:

    function redraw() external onlyOwner returns (uint256) {

Tools Used

VS Code

Recommended Mitigation Steps

The protocol has placed a lot of trust in the owner. Users should be able to call redraw as well.

@code423n4 code423n4 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 Dec 16, 2022
code423n4 added a commit that referenced this issue Dec 16, 2022
@c4-judge
Copy link
Contributor

gzeon-c4 marked the issue as primary issue

@c4-judge c4-judge added the primary issue Highest quality submission among a set of duplicates label Dec 17, 2022
@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Dec 17, 2022
@c4-judge
Copy link
Contributor

gzeon-c4 marked the issue as satisfactory

@gzeoneth
Copy link
Member

I think this is low risk given the permissioned design of the contract, will wait for sponsor comment.

@iainnash
Copy link

iainnash commented Dec 19, 2022

@gzeoneth Agreed with low/QA. The contract is permissioned due to the dependency on chainlink and a relative level of trust of the owner.

@c4-sponsor
Copy link

iainnash marked the issue as sponsor disputed

@c4-sponsor c4-sponsor added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Jan 1, 2023
@c4-judge c4-judge added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Jan 7, 2023
@c4-judge
Copy link
Contributor

c4-judge commented Jan 7, 2023

gzeon-c4 changed the severity to QA (Quality Assurance)

@c4-judge c4-judge added the downgraded by judge Judge downgraded the risk level of this issue label Jan 7, 2023
@c4-judge
Copy link
Contributor

c4-judge commented Jan 7, 2023

gzeon-c4 marked the issue as grade-b

@captainmangoC4 captainmangoC4 removed the primary issue Highest quality submission among a set of duplicates label Jan 26, 2023
@C4-Staff C4-Staff added the Q-14 label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue grade-b Q-14 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax satisfactory satisfies C4 submission criteria; eligible for awards sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Projects
None yet
Development

No branches or pull requests

7 participants