SigRec: Automatic Recovery of Function Signatures in Smart Contracts

05/11/2023
by   Ting Chen, et al.
0

Millions of smart contracts have been deployed onto Ethereum for providing various services, whose functions can be invoked. For this purpose, the caller needs to know the function signature of a callee, which includes its function id and parameter types. Such signatures are critical to many applications focusing on smart contracts, e.g., reverse engineering, fuzzing, attack detection, and profiling. Unfortunately, it is challenging to recover the function signatures from contract bytecode, since neither debug information nor type information is present in the bytecode. To address this issue, prior approaches rely on source code, or a collection of known signatures from incomplete databases or incomplete heuristic rules, which, however, are far from adequate and cannot cope with the rapid growth of new contracts. In this paper, we propose a novel solution that leverages how functions are handled by Ethereum virtual machine (EVM) to automatically recover function signatures. In particular, we exploit how smart contracts determine the functions to be invoked to locate and extract function ids, and propose a new approach named type-aware symbolic execution (TASE) that utilizes the semantics of EVM operations on parameters to identify the number and the types of parameters. Moreover, we develop SigRec, a new tool for recovering function signatures from contract bytecode without the need of source code and function signature databases. The extensive experimental results show that SigRec outperforms all existing tools, achieving an unprecedented 98.7 percent accuracy within 0.074 seconds. We further demonstrate that the recovered function signatures are useful in attack detection, fuzzing and reverse engineering of EVM bytecode.

READ FULL TEXT

page 3

page 4

page 10

page 24

page 25

page 26

page 27

page 29

research
01/30/2023

Neural-FEBI: Accurate Function Identification in Ethereum Virtual Machine Bytecode

Millions of smart contracts have been deployed onto the Ethereum platfor...
research
11/03/2020

Smart-Corpus: an Organized Repository of Ethereum Smart Contracts Source Code and Metrics

Many empirical software engineering studies show that there is a great n...
research
05/21/2021

SCSGuard: Deep Scam Detection for Ethereum Smart Contracts

Smart contract is the building block of blockchain systems that enables ...
research
05/16/2020

Why Do Smart Contracts Self-Destruct? Investigating the Selfdestruct Function on Ethereum

The Selfdestruct function is provided by Ethereum smart contracts to des...
research
05/01/2021

Targeting the Weakest Link: Social Engineering Attacks in Ethereum Smart Contracts

Ethereum holds multiple billions of U.S. dollars in the form of Ether cr...
research
05/30/2021

Reflow: Zero Knowledge Multi Party Signatures with Application to Distributed Authentication

Reflow is a novel signature scheme supporting unlinkable signatures by m...
research
06/17/2021

Smart Contract Vulnerability Detection: From Pure Neural Network to Interpretable Graph Feature and Expert Pattern Fusion

Smart contracts hold digital coins worth billions of dollars, their secu...

Please sign up or login with your details

Forgot password? Click here to reset