Smart contract transactions are increasingly interleaved by cross-contract calls. While many tools have been developed to identify a common set of vulnerabilities, the cross-contract vulnerability is overlooked by existing tools. Cross-contract vulnerabilities are exploitable bugs that manifest in the presence of more than two interacting contracts. Existing methods are however limited to analyze a maximum of two contracts at the same time. Detecting cross-contract vulnerabilities is highly non-trivial. With multiple interacting contracts, the search space is much larger than that of a single contract. To address this problem, we present xFuzz, a machine learning guided smart contract fuzzing framework. The machine learning models are trained with novel features (e.g., word vectors and instructions) and are used to filter likely benign program paths. Comparing with existing static tools, machine learning model is proven to be more robust, avoiding directly adopting manually-defined rules in specific tools. We compare xFuzz with three state-of-the-art tools on 7,391 contracts. xFuzz detects 18 exploitable cross-contract vulnerabilities, of which 15 vulnerabilities are exposed for the first time. Furthermore, our approach is shown to be efficient in detecting non-cross-contract vulnerabilities as well -- using less than 20% time as that of other fuzzing tools, xFuzz detects twice as many vulnerabilities.
翻译:智能合同交易越来越多地被交叉合同电话所干扰。 虽然已经开发了许多工具来识别共同的薄弱环节, 但现有工具忽略了跨合同的脆弱性。 跨合同的脆弱性是两个以上互动合同所显示的可利用的错误。 但是,现有方法仅限于分析最多两个合同, 现有方法仅限于同时分析最多两个合同。 检测跨合同的脆弱性非常非三角性。 通过多个互动合同, 搜索空间大大大于单一合同的搜索空间。 为了解决这一问题, 我们提供了 xFuzz, 一个机器学习的智能合同模糊框架。 机器学习模型具有新特点( 如文字矢量和指示), 并且用来过滤可能的良好程序路径。 与现有的静态工具相比, 机器学习模式被证明更加可靠, 避免在具体工具中直接采用手工定义的规则。 我们比较了 xFuzz 和 7 391 合同的三种最先进的工具。 xFuzz 检测了18个可利用的跨合同脆弱性, 其中15个脆弱性首次暴露。 此外,我们的方法比其他20个脆弱性检测工具要低一倍。 显示我们的方法比其他弱点要有效。