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

lostAndFoundAddress: there is a (potentially very low) possibility that someone owns 0x0 public address #38

Open
pauliax opened this issue Nov 18, 2018 · 3 comments
Assignees

Comments

@pauliax
Copy link

pauliax commented Nov 18, 2018

Description

OffersAccessControl.sol has a function withdrawTotalLostAndFoundBalance() with the onlyLostAndFound modifier which checks if the msg.sender is the lostAndFoundAddress:
require(msg.sender == lostAndFoundAddress, "only LostAndFound is allowed to perform this operation");
However, there is a slight possibility that someone could own the private key which corresponds to 0x0 address. Then, he or she will be able to call the functions which have this modifier when the lostAndFoundAddress is not initialized.

From: https://ethereum.stackexchange.com/questions/50596/what-s-the-point-of-checking-msg-sender%E2%89%A00-are-there-cases-where-msg-sender-can

"How msg.sender can be equal to 0 ?

Having said all this, address 0x0 is a perfectly valid address. It's just as possible that you'll find the private key to this address as to any other address. If someone does find the associated private key, yes, they'll be very rich, given this address's use as a burn address. (There's a small caveat: not all addresses have associated private keys, given the way addresses are generated. There's no way to know whether address 0x0 is one of these addresses.)"

Scenario

To exploit this vulnerability someone must own the private key which corresponds to 0x0 public key.

Impact

The impact is high, however, the possibility is low.

Reproduction

Fix

Add check that the address is initialized:

    modifier onlyLostAndFound() {
        require(msg.sender == lostAndFoundAddress && lostAndFoundAddress != address(0), "only LostAndFound is allowed to perform this operation");
        _;
    }

Ethereum address

0x09Cf79Bdf8F68739979C8c825C103A7538Bd4f4b

@ghost
Copy link

ghost commented Nov 19, 2018

This issue was addressed in Issue #12, but for further context:

The probability of someone owning the private key to 0x0 is so low that we cannot truly comprehend it. To put this in perspective:

[–]theonetruesexmachine 1 year ago
The exact number of Ethereum addresses is therefore 2160, or "1 quindecillion 461 quattuordecillion 501 tredecillion 637 duodecillion 330 undecillion 902 decillion 918 nonillion 203 octillion 684 septillion 832 sextillion 716 quintillion 283 quadrillion 19 trillion 655 billion 932 million 542 thousand 976".

It's not really in our human capacity to understand either numbers that large, or how quickly exponential functions grow (we simply have no physical reference frame for this).

Source: https://www.reddit.com/r/ethereum/comments/6s1wzp/probably_a_stupid_question_about_mew_vulnerability/?st=jonsqolr&sh=60551668

@hwrdtm
Copy link
Contributor

hwrdtm commented Nov 19, 2018

Thanks @pauliax for your feedback! We will take it into consideration.

@hwrdtm hwrdtm self-assigned this Nov 19, 2018
@arthcmr
Copy link
Contributor

arthcmr commented Nov 27, 2018

Thanks for your participation, @pauliax! Our team has reviewed your submission and decided to reject the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants