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

setupParticipant() function does not check for zero address #130

Open
code423n4 opened this issue Nov 29, 2021 · 1 comment
Open

setupParticipant() function does not check for zero address #130

code423n4 opened this issue Nov 29, 2021 · 1 comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Handle

jayjonah8

Vulnerability details

Impact

The setupParticipant() function in AuctionParticipant.sol does not have require statements to protect again contracts that do not yet exist. It sets the addresses for " _impliedCollateralService", "_rewardToken", and "_auction" and can only be called once so its vital to have this guard in place.

Proof of Concept

https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/AuctionParticipant.sol#L26

Tools Used

Manual code review

Recommended Mitigation Steps

Add require checks for the addresses that are passed in the setupParticipant() function checking if they exist like: require("address" != address(0), "contract does not exist")

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Nov 29, 2021
code423n4 added a commit that referenced this issue Nov 29, 2021
@0xScotch 0xScotch added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Dec 8, 2021
@GalloDaSballo
Copy link
Collaborator

The check against address 0 is a good idea for vital parts of the code.
However the warden didn't show any specific attack or vulnerability that would be exposed by setting any of those variables to address(0)
I agree with adding the check, mostly because it's a best-practice, however am going to downgrade the finding to low severity, which is in line with the severity given by most auditing firms for this type of finding.

@GalloDaSballo GalloDaSballo added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

3 participants