CVE-2024-45304
📋 TL;DR
This vulnerability in Cairo-Contracts for Starknet allows unauthorized ownership transfer after an owner renounces ownership. A pending owner can gain control when the contract should be ownerless, or a malicious owner can simulate renouncing ownership to later regain control. All users of vulnerable Cairo-Contracts versions are affected.
💻 Affected Systems
- OpenZeppelin Cairo-Contracts
📦 What is this software?
Contracts by Openzeppelin
⚠️ Risk & Real-World Impact
Worst Case
Complete contract takeover by unauthorized party leading to asset theft, contract manipulation, or denial of service.
Likely Case
Unauthorized ownership transfer enabling control over contract functions and assets.
If Mitigated
No impact if upgraded to patched version or contract not using ownership features.
🎯 Exploit Status
Requires understanding of Cairo/Starknet contract interactions and ownership state manipulation.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.16.0
Vendor Advisory: https://github.com/OpenZeppelin/cairo-contracts/security/advisories/GHSA-w2px-25pm-2cf9
Restart Required: No
Instructions:
1. Update Cairo-Contracts dependency to version 0.16.0 or later. 2. Recompile and redeploy affected smart contracts. 3. Verify contract functionality post-upgrade.
🔧 Temporary Workarounds
No workarounds available
allVendor states there are no known workarounds for this vulnerability
🧯 If You Can't Patch
- Monitor contract ownership changes and transaction patterns for suspicious activity
- Consider migrating critical functionality to new contracts using patched Cairo-Contracts version
🔍 How to Verify
Check if Vulnerable:
Check if your Cairo-Contracts dependency version is below 0.16.0 in your project configuration
Check Version:
Check your project's Scarb.toml or package.json for Cairo-Contracts version
Verify Fix Applied:
Confirm Cairo-Contracts version is 0.16.0 or higher and verify contract ownership logic behaves correctly
📡 Detection & Monitoring
Log Indicators:
- Unexpected ownership transfer events after renounceOwnership calls
- Pending owner becoming owner after ownership renounced
Network Indicators:
- Suspicious transactions calling ownership functions in unexpected sequences
SIEM Query:
Not applicable - blockchain transactions are public ledger events rather than traditional network logs