Smart Contract Control Flow Integrity via Runtime Graph Validation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing solutions for securing smart contracts in blockchains, such as Ethereum, are inadequate in preventing vulnerabilities like re-entrancy issues and control flow deviations, which can lead to significant financial losses, as seen in notable attacks like the DAO hack, due to limitations in static and dynamic analysis methods.
Innovation Solution
Implementing control-flow integrity (CFI) with run-time monitoring using control-flow graphs (CFGs) to validate smart contract execution paths, ensuring that transactions adhere to pre-defined legitimate execution paths, thereby preventing malicious exploits and enhancing security.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If static analysis tools like OYENTE are used to analyze smart contract bytecode, then developers can identify potential vulnerabilities before deployment, but the contracts remain vulnerable during runtime execution
Solution Approach 1:
The patent applies preliminary action by pre-determining the control flow graph (CFG) and establishing expected control flow paths before the smart contract executes. The CFG is constructed from the contract's bytecode, identifying all valid instruction sequences and jump targets. This preliminary analysis enables runtime verification without requiring complex static analysis tools during deployment, as the validation logic is already embedded in the CFG structure.
Solution Approach 2:
The patent implements feedback by continuously monitoring the actual control flow during smart contract execution and comparing it against the pre-determined expected control flow paths in the CFG. When a deviation is detected (e.g., unexpected jump targets or invalid instruction sequences), the system immediately identifies the anomaly and can terminate execution or alert stakeholders, providing real-time security feedback without requiring complex post-execution analysis.
2Adaptability or versatility
If Turing-complete programming language is provided for smart contracts, then arbitrary applications can be executed on the blockchain, but vulnerabilities like re-entrancy problems and control flow deviations can occur
Solution Approach 1:
The patent introduces an intermediary layer (the control flow verification mechanism) between the Turing-complete smart contract language and the blockchain execution environment. The CFG acts as a mediator that translates the high-level contract logic into verified control flow paths, allowing complex functionality to execute while preventing harmful deviations. This intermediary verification layer enables versatile smart contracts to run securely by filtering out malicious control flow patterns.
3Reliability
If existing security solutions like formal verification and symbolic execution are implemented, then some vulnerabilities can be detected, but adequate security is still not provided against runtime exploits
Solution Approach 1:
The patent replaces complex mechanical security verification systems (formal verification and symbolic execution) with a more efficient control flow graph-based verification mechanism. Instead of performing exhaustive mathematical proofs or symbolic analysis during execution, the system uses the CFG to efficiently track and validate control flow paths in real-time. This substitution maintains security while significantly reducing the time and computational resources required for verification.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A method for securing smart contracts in a blockchain includes receiving in the blockchain a contract creation transaction having a control flow graph (CFG) and contract code for a smart contract to be created. The contract creation transaction is verified by checking a signature of a creator of the smart contract and determining that the CFG is correct based on the contract code. The verified contract creation transaction is included as a block in a distributed ledger of the blockchain.