Smart Contract Control Flow Integrity via Runtime Graph Validation

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvesmart contract securityVSAvoidanalysis system complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #23Feedback

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

Engineering Contradiction:
Improvesmart contract functionalityVSAvoidsmart contract vulnerabilities
Core Design Contradiction:
Adaptability or versatilityVSObject-affected harmful factors

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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

Engineering Contradiction:
Improvesmart contract securityVSAvoidsecurity verification time
Core Design Contradiction:
ReliabilityVSLoss of time

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.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentEP3477569B1Method and system for securing smart contracts in blockchains
Publication Date: 2023.02.15 NEC CORP
  • EP3477569B1 patent drawingFigure 1
  • EP3477569B1 patent drawingFigure 2
  • EP3477569B1 patent drawingFigure 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.