code-423n4 / 2023-01-drips-findings

0 stars 2 forks source link

Admin of the upgradeable proxy contracts can rug users #103

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Lines of code

https://github.com/code-423n4/2023-01-drips/blob/9fd776b50f4be23ca038b1d0426e63a69c7a511d/src/Managed.sol#L18 https://github.com/code-423n4/2023-01-drips/blob/9fd776b50f4be23ca038b1d0426e63a69c7a511d/src/Managed.sol#L157 https://github.com/code-423n4/2023-01-drips/blob/9fd776b50f4be23ca038b1d0426e63a69c7a511d/src/DripsHub.sol#L53 https://github.com/code-423n4/2023-01-drips/blob/9fd776b50f4be23ca038b1d0426e63a69c7a511d/src/AddressDriver.sol#L19 https://github.com/code-423n4/2023-01-drips/blob/9fd776b50f4be23ca038b1d0426e63a69c7a511d/src/NFTDriver.sol#L19 https://github.com/code-423n4/2023-01-drips/blob/9fd776b50f4be23ca038b1d0426e63a69c7a511d/src/ImmutableSplitsDriver.sol#L11

Vulnerability details

Impact

The proxy admin can steal all the tokens approved to the proxy contract from users' wallets. Contracts DripsHub, AddressDriver, NFTDriver have this vulnerability. The proxy admin of the drivers can steal its users' tokens in the DripsHub. Contracts AddressDriver and NFTDriver have this vulnerability. The proxy admin of DripsHub can steal all users' and drivers' tokens in it.

Proof of Concept

All of contracts DripsHub, AddressDriver, NFTDriver, ImmutableSplitsDriver inherit from the Managed contract, and will be deployed as a implementation of an upgradeable ManagedProxy contract. The admin of the ManagedProxy contract can upgrade the implementation to any contract. A hacked admin or malicious admin can perform arbitrary malicious actions by upgrading the contract.

For DripsHub:

For AddressDriver, NFTDriver:

For ImmutableSplitsDriver:

Tools Used

VS Code

Recommended Mitigation Steps

We should use a non-upgradeable contract to hold user's allowances.

For all of the official drivers(AddressDriver, NFTDriver, ImmutableSplitsDriver), consider removing the upgradability.

For DripsHub:

c4-judge commented 1 year ago

GalloDaSballo marked the issue as unsatisfactory: Out of scope

GalloDaSballo commented 1 year ago

Upgradeability per-se is OOS