Stack Walking for ROP Attack Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional methods for detecting Return-oriented-programming (ROP) attacks can only identify them after they occur and require source code analysis or instrumentation, which is not always available in production environments, and they fail to prevent ROP attacks before they execute.

Innovation Solution

The solution employs stack walking and exception handler table information to detect inconsistencies between program code and stack status, allowing for proactive detection and prevention of ROP attacks by identifying ROP gadgets before execution, even without source code analysis, using a variant of stack walking techniques to validate consistency and extract the full sequence of injected gadgets.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If conventional ROP detection methods (Indirect Branch Tracing, ROP gadget identification) are used, then ROP attacks can be detected after execution, but they cannot prevent attacks before execution and require source code analysis or instrumentation which is not available in production environments

Engineering Contradiction:
ImproveROP attack detection capabilityVSAvoidDetection timing (after attack execution)
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent performs stack walking and consistency validation before ROP gadgets are executed. By checking the stack structure and exception handler table information in advance, the system can detect ROP attacks at the stack preparation stage rather than after gadget execution, thus preventing the attack from completing its malicious objectives

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary detection mechanism that operates between the attacker's code injection and the actual ROP gadget execution. This intermediary layer validates stack consistency and exception handler information, blocking the attack chain before it can execute malicious gadgets while not requiring modification of the original program code

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If source code analysis or instrumentation is used for ROP detection, then detection accuracy can be improved, but such information is not available in production environments where programs are deployed without supporting information

Engineering Contradiction:
ImproveROP attack detection accuracyVSAvoidDeployment environment compatibility
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent enables the detection system to extract all necessary information from the running program itself without external support. By performing stack walking on the current process stack and analyzing the exception handler table that is already present in the deployed binary, the system achieves high detection accuracy without requiring source code, debug symbols, or any additional instrumentation that would limit deployment environments

Inventive Principle:
Principle #25Self-service

3Reliability

If conventional detection methods are used, then ROP attacks can be identified, but they fail to prevent ROP attacks before they execute and cannot mitigate impact on the operating system or other programs

Engineering Contradiction:
ImproveROP attack identification capabilityVSAvoidImpact on operating system and other programs
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent applies preliminary anti-action by detecting and blocking ROP attacks at the stack validation stage, before the malicious gadgets can execute and cause harm. By identifying inconsistent stack structures or invalid exception handler references during stack walking, the system prevents the attack chain from progressing to the point where it can compromise the operating system or other programs

Inventive Principle:
Principle #9Preliminary anti-action

Data Source

PatentEP3175386B1Transparent detection and extraction of return-oriented-programming attacks
Publication Date: 2021.04.14 NEC CORP
  • EP3175386B1 patent drawingFigure 1
  • EP3175386B1 patent drawingFigure 2
  • EP3175386B1 patent drawingFigure 3

AI summary

Systems and methods for detection and prevention of Return-Oriented-Programming (ROP) attacks in one or more applications, including an attack detection device and a stack inspection device for performing stack inspection to detect ROP gadgets in a stack. The stack inspection includes stack walking from a stack frame at a top of the stack toward a bottom of the stack to detect one or more failure conditions, determining whether a valid stack frame and return code address is present; and determining a failure condition type if no valid stack frame and return code is present, with Type III failure conditions indicating an ROP attack. The ROP attack is contained using a containment device, and the ROP gadgets detected in the stack during the ROP attack are analyzed using an attack analysis device.