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

Purity checker does not filter STATICCALL opcode #170

Open
paulhauner opened this issue Jun 7, 2018 · 7 comments
Open

Purity checker does not filter STATICCALL opcode #170

paulhauner opened this issue Jun 7, 2018 · 7 comments
Labels

Comments

@paulhauner
Copy link
Contributor

paulhauner commented Jun 7, 2018

As defined in EIP214, the STATICCALL opcode allows a contract to read the mutable state of another contract.

The purity checker does not blacklist this opcode. I think it should.

EDIT: STATICCALL should not be blacklisted - instead filtered so that it may only be used upon pre-approved addresses.

@ChihChengLiang
Copy link
Contributor

Looks like this can be better handled by adding STATICCALL in the banned opcode lists in #169 .

@paulhauner
Copy link
Contributor Author

paulhauner commented Jun 7, 2018

Actually I was wrong when I said "blacklist". It actually needs to be treated like other CALL codes and filtered so it can only be directed at pre-approved contracts. Will update title.

@paulhauner
Copy link
Contributor Author

paulhauner commented Jun 7, 2018

Here's a thought... blacklist CALL and permit only STATICCALL? Probably unnecessary.

EDIT: I retract this statement. I don't see a good reason to blacklist CALL.

@ChihChengLiang
Copy link
Contributor

ChihChengLiang commented Jun 7, 2018

looks like it's handled here https://github.com/ethereum/casper/pull/169/files#diff-33d26a5c0d90fb3b88e7aed738a11fc5R71

Where

CALL = 0xf1
CALLCODE = 0xf2
DELEGATECALL = 0xf4
STATICCALL = 0xfa

@paulhauner
Copy link
Contributor Author

Where exactly? I don't see 0xfa in the is_some_call() code.

@ChihChengLiang
Copy link
Contributor

ah sorry, I mean 0xfa are treated differently from other CALLs. Is that what you want?

@paulhauner
Copy link
Contributor Author

Oh, sorry I think I misunderstood!

Yes, I think STATICCALL should be added to that code you linked. ☺️

@paulhauner paulhauner changed the title Purity checker does not block STATICCALL opcode Purity checker does not filter STATICCALL opcode Jun 7, 2018
@djrtwo djrtwo added the bug label Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants