Short Paper: SlotCollider - Detecting Storage Slot Collisions in Ethereum Smart Contracts
Abstract
Smart contract contains both the code and its internal storage data on the chain. This storage data needs to be properly aligned and laid out in the storage trie. Otherwise, it could lead to storage collisions resulting in unexpected behavior or storage-based security exploits such as the Audius hack [1]. In this paper, with our SlotCollider tool, we explore slot collisions that occur when two or more variables share the same storage slots in a proxy contract. Many existing tools rely solely on bytecode analysis for collision detection, but this approach suffers from both false positives and negatives, and is not enough to fully understand the storage layout and complex data types. SlotCollider addresses these issues with the source code based analysis of smart contracts and also incorporates on-chain data for further precision. We evaluated SlotCollider on a set of 4,890 smart contracts that detected an additional 6,558 storage collisions that were missed by other tools [2]. The SlotCollider outperforms existing tools in detection and provides more accurate and reliable results to detect storage collisions in Ethereum smart contracts.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.