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

Dangerous toggle functions #157

Open
code423n4 opened this issue Jun 16, 2021 · 0 comments
Open

Dangerous toggle functions #157

code423n4 opened this issue Jun 16, 2021 · 0 comments
Labels

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

Vulnerability Details

Usually one tries to avoid toggle functions in blockchains, because it could be that you think that the first transaction you sent was not correctly submitted (but it's just pending for a long time), or you might even be unaware that it was already sent if multiple roles can set it (like with changeMarketApproval / onlyGovernors) or if it's an msig.
This results in potentially double-toggling the state, i.e, it is set to the initial value again.

Some example functions: changeMarketCreationGovernorsOnly, changeMarketApproval, and the ones that follow.

Impact

The outcome of toggle functions is hard to predict on blockchains due to the very async nature and lack of information about pending transactions.

Recommended Mitigation Steps

Use functions that accept a specific value as a parameter instead.

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

2 participants