Full Report
Audius is a blockchain music platform. In July of 2023, the governance was hacked. The Audius governance contract utilizes the OpenZeppelin proxy upgrade pattern. They override the standard implementation with AudiusAdminUpgradeabilityProxy. This contract is used to change the implementation contract being used. The contract AudiusAdminUpgradabilityProxy uses storage slot 0 for the address proxyAdmin. Additionally, the implementation contract used the OpenZeppelin Initializable contract. This contract had the variable initialized and initializing in the first few slots of the implementation contract. The address of the proxyadmin was 0x4deca517d6817b6510798b7328f2314d3003abac. This led to both initializing and initialized to be truthy values! What does this mean? The initializer modifier would always succeed, allowing for reinitializing of the implementation contract over and over again. This bug allowed the attacker to deploy Audius contract and change the storage state that was only intended to be set once during initialization. Using this, they were able to redefine the voting protocol and give themselves a ton of money. To fix this vulnerability, the team used the vulnerability to patch a simple contract. Then, they were able to add the new version of the implementation that did not overlap with the proxyAdmin address for the initialize functions. The vulnerability existed in the project for 2 years without anybody noticing. Considering the team used two well-defined and audited contracts, it is crazy that this vulnerability ever existed. Good report on the finding though!
Analysis Summary
# Incident Report: Audius Governance Storage Collision Exploit
## Executive Summary
In July 2023, the Audius blockchain music platform suffered a governance exploit due to a storage slot collision between its proxy contract and its implementation contract. An attacker exploited this vulnerability to reinitialize the governance contract, allowing them to redefine voting protocols and illicitly transfer funds. The Audius team mitigated the threat by utilizing the vulnerability itself to deploy a patch, eventually migrating to a new implementation with corrected storage layouts.
## Incident Details
- **Discovery Date:** July 2023
- **Incident Date:** July 2023 (Vulnerability existed since approx. 2021)
- **Affected Organization:** Audius
- **Sector:** Decentralized Finance (DeFi) / Blockchain Media
- **Geography:** Global / Decentralized
## Timeline of Events
### Initial Access
- **Date/Time:** July 2023
- **Vector:** Smart Contract Storage Collision
- **Details:** The attacker identified that the `proxyAdmin` address stored in slot 0 of the `AudiusAdminUpgradeabilityProxy` overlapped with the `initialized` and `initializing` variables in the implementation contract.
### Lateral Movement
- **Privilege Escalation:** By exploiting the truthy values in the initialization slots, the attacker bypassed the `initializer` modifier. This allowed them to call the `initialize()` function repeatedly on a deployed contract.
### Data Exfiltration/Impact
- **Governance Hijack:** The attacker reinitialized the governance parameters, effectively redefining the voting protocol to grant themselves unauthorized voting power.
- **Financial Theft:** Using the compromised governance power, the attacker authorized the transfer of a significant amount of Audius tokens to their own address.
### Detection & Response
- **Discovery:** The incident was detected following unauthorized governance changes and large-scale fund movements.
- **Response Actions:** The Audius team performed a "white-hat" exploit using the same vulnerability to deploy a temporary patch. This halted further exploitation until a permanent, non-overlapping implementation could be deployed.
## Attack Methodology
- **Initial Access:** Exploitation of logic flaw in smart contract storage layout.
- **Persistence:** N/A (One-time state manipulation).
- **Privilege Escalation:** Re-initialization of a "singleton" contract to gain administrative/governance control.
- **Defense Evasion:** The vulnerability remained dormant for 2 years because it resided in the interaction between two individually audited, standard contract patterns.
- **Discovery:** Monitoring of storage slot 0 layouts.
- **Impact:** Manipulation of contract state variables to redirect funds.
## Impact Assessment
- **Financial:** Significant loss of Audius tokens (estimated "a ton of money" per report context).
- **Data Breach:** N/A (Public blockchain state was modified).
- **Operational:** Governance functions were suspended and required a manual migration/patching process.
- **Reputational:** High; the vulnerability existed for two years despite the use of audited OpenZeppelin patterns.
## Indicators of Compromise
- **Network indicators:** Transactions interacting with `AudiusAdminUpgradeabilityProxy` calling `initialize()` multiple times.
- **Address indicators:** `0x4deca517d6817b6510798b7328f2314d3003abac` (The proxyAdmin address that caused the truthy collision).
- **Behavioral indicators:** Unexpected changes to voting thresholds or governance logic without community consensus.
## Response Actions
- **Containment:** The team utilized the exploit mechanism to overwrite the malicious state with a "simple" patched contract.
- **Eradication:** Deployed a new version of the implementation contract.
- **Recovery:** Corrected the storage layout to ensure the `proxyAdmin` address no longer overlapped with the `Initializable` variables.
## Lessons Learned
- **Key Takeaways:** Even audited, industry-standard libraries (like OpenZeppelin) can become vulnerable when custom overrides change the expected storage layout.
- **Storage Layout Awareness:** Proxies and implementations must be audited together specifically for storage slot collisions.
- **Latent Vulnerabilities:** Significant bugs can remain undetected for years (2 years in this case) even in high-value production environments.
## Recommendations
- **Automated Tooling:** Use static analysis tools (e.g., Slither) specifically configured to detect storage slot overlaps between proxies and implementations.
- **Adherence to Standards:** Avoid overriding standard proxy patterns unless absolutely necessary; if overriding, strictly follow EIP-1967 storage slot conventions.
- **Regular Re-Audits:** Perform periodic security reviews when updating implementation contracts to ensure no new overlaps are introduced.