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

Possible to call setup with invalid owner array #244

Closed
rmeissner opened this issue Jan 15, 2021 · 0 comments · Fixed by #261
Closed

Possible to call setup with invalid owner array #244

rmeissner opened this issue Jan 15, 2021 · 0 comments · Fixed by #261

Comments

@rmeissner
Copy link
Member

There is a bug within the setupOwners function on OwnerManager.sol, which allows duplicate owners to be onboarded when the duplicated address is next to itself in the _owners array.

This could cause a couple of unexpected behaviors and potentially cause users to lose access to their funds. It could allow the owner of the safe to set the threshold to something unreachable, potentially making it so they could not execute a safe transaction. It could also lock users out of their funds if they choose to transfer them to a CREATE2 address then set up the contract with duplicated owners and a too high threshold.

Tests

Tests can be found on https://github.com/gnosis/safe-contracts/tree/duplicate-owners

The duplicateOwners test file sets up a safe with duplicated owners. It shows that the getOwner arrays are returned with a single instance of the duplicated address and the zero address.

(The zero address appears because the owner count is higher than the number of owners in the owners mapping, so the array created in getOwners doesn’t get filled to its declared length.)

It also shows that the threshold can be maxed out so that the threshold is higher than the number of owners. All the tests provided pass but should fail on the proxy creation because of the duplicated owners.

@rmeissner rmeissner added bug future Features for next major contract version labels Jan 15, 2021
@rmeissner rmeissner added this to the contracts-safe-1.3.0 milestone Jan 18, 2021
@rmeissner rmeissner removed the future Features for next major contract version label Mar 19, 2021
Saw-mon-and-Natalie pushed a commit to Saw-mon-and-Natalie/safe-contracts that referenced this issue Nov 1, 2023
fdarian pushed a commit to fdarian/safe-contracts that referenced this issue Jan 14, 2024
Add user nonce to TransactionOptions type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant