In the UUPS pattern, `_authorizeUpgrade()` is the function responsible for controlling who can upgrade the implementation and check if new implementation is compatible with interface.
In ThunderLoan.sol the function does not verify that `newImplementation` is compatible with the expected protocol interface. An owner could upgrade to a contract that compiles and deploys successfully but does not correctly implement the ThunderLoan
Likelihood:
This issue may arise each time the implementation contract undergoes an upgrade passing non-compatible contract.
Impact:
If the owner upgrades to an incompatible implementation, all core protocol functions become permanently broken — liquidity providers lose access to their deposited funds via `redeem()`, active flash loans cannot be repaid via `repay()`, and no new loans can be issued via `flashloan()`.
Unlike most vulnerabilities that can be mitigated by pausing the protocol or deploying a fix, an upgrade to an incompatible implementation under UUPS is irreversible — if the new implementation does not expose a valid `upgradeTo()` function, the proxy is permanently bricked with no recovery path, resulting in total loss of all funds locked in the protocol.
The test verifies that `_authorizeUpgrade()` does not validate interface compatibility before allowing an upgrade. First, it confirms that `deposit()` works correctly under the original implementation. Then, the owner upgrades the proxy to a completely incompatible contract — the upgrade succeeds because `_authorizeUpgrade()` only checks `onlyOwner`. Finally, the test proves the impact by showing that both `deposit()` and `redeem()` revert after the upgrade, permanently locking all deposited funds with no recovery path.
This is the correct interfac
This is the non-compatible new implementation:
Consider validating the `newImplementation` address inside `_authorizeUpgrade()` by verifying that it correctly implements the expected interface before allowing the upgrade to proceed. This ensures that any incompatible implementation is rejected at the authorization step rather than silently breaking the protocol after the upgrade is executed.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.