Skip to content

This repository introduces our research in source code verifier, including PoC, related issues implementation code and other content.

Notifications You must be signed in to change notification settings

source-code-scam-paper/source-scam-all-in-one

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

source-scam-all-in-one

This repository introduces our research in source code verifier, including PoC, related issues implementation code and other content.

Description of each risk PoC

The following table shows the PoC of the source code fraud attack and the credit.

Attack Item (PoC)Victim or Normal Contract (PoC)Attack Contract Related implementations Fix
(R1)Exploitable Compiler Features Victim in Etherscan Attack Contract in Etherscan -- Report via private channel
(R2)Unchecked Simulated Execution Normal Contract in Etherscan Attacked Contract in Sourcify L196-L256 credit
(R3)Incomplete Bytecode Validation Normal Contract in Etherscan Attacked Contract in Sourcify L280-L286 credit
(R4)Unreliable Client Node Etherscan Waring sourcify PoC,Blockscout PoCEtherscan PoC -- confirm
(R5)Unverified Linked -- Attack Contract in Etherscan -- confirm
(R6 PoC#1) Mislabeled Bytecode Normal Contract in Etherscan Attack Contract in Blockscout L100-L121 credit
(R6PoC#2) Mislabeled Bytecode Normal Contract in Etherscan Attack Contract in Sourcify L383-L411 credit
(R7)Path Traversal Risk SimToken Contract In Etherscan Sourcify PoC -- credit
(R8)Inadequate Information Disclosure -- etherscan PoC,blockscout PoC -- confirm

Attacks on Downstream Applications

Here, we demonstrate crytic-compile-based vulnerabilities such as Slither as well as Echidna, which exploit malicious source code verification results to achieve overwriting of locally arbitrary files.

Blackbox Testing in Etherscan

Q1. Whether Etherscan performs source code verification based on runtime code, bytecode, or even both of them;

Blackbox Testing & Answer 1

Q2. How Etherscan handles immutable variables in M3;

Blackbox Testing & Answer 2

Q3. How Etherscan flags metadata code, and whether it can handle multiple pieces of metadata code in M4;

Blackbox Testing & Answer 3

Q4. Does Etherscan require users to provide specific values for constructor parameters in M4;

Blackbox Testing & Answer 4

Q5. What database does Etherscan use to store source code verification results in M5;

We didn't find any indication in the documentation that Etherscan uses decentralized storage.

Q6. Does Etherscan have shortcut

Based on 0xb1405.. contract, we confirmed the existence of a shortcut for the same runtime code in Etherscan.

Acknowledgements

Many thanks to Sourcify and to Blockscout for their fantastic open source work. Without them, we wouldn't have been able to get an open source, trusted source code verification service. We were very very impressed by their responsible and professional technical skills in our interaction with them. We were also blown away by the speed with which they fixed the problem, all within 12 hours of our report. Thanks very very much to the help of related security expert samczsun, who made our research more fulfilling.

About

This repository introduces our research in source code verifier, including PoC, related issues implementation code and other content.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages