Diamond Inheritance Exploit Prevention via Offset Validation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing object-oriented programming languages face vulnerabilities due to ambiguity in diamond inheritance, where multiple inheritance leads to unintended behavior and potential exploits, allowing hackers to gain control over applications.

Innovation Solution

A system and method to determine if an object is associated with a class having diamond inheritance, and if so, prevent exploits by using a table of offsets between classes and objects to verify the integrity and trustworthiness of the object, thereby blocking unwanted code execution.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If multiple inheritance is implemented to allow classes to inherit from multiple base classes, then code reusability and flexibility are improved, but ambiguity and security vulnerabilities arise in diamond inheritance scenarios

Engineering Contradiction:
Improvecode reusabilityVSAvoidbehavioral ambiguity
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent segments the class hierarchy by identifying and separating virtual base classes from regular base classes. It introduces a mechanism to detect diamond inheritance patterns and segment the inheritance path to prevent ambiguous behavior, allowing multiple inheritance to be used safely without the risks of diamond inheritance.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary mechanism in the form of a runtime check that mediates between the multiple inheritance structure and the object instantiation process. This intermediary detects diamond inheritance patterns and prevents exploitation by validating the inheritance hierarchy before allowing object creation or method resolution.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If compilers store offsets for virtual base classes to enable polymorphic behavior, then dynamic polymorphism is achieved, but security vulnerabilities are created that allow hackers to gain control

Engineering Contradiction:
Improvedynamic polymorphismVSAvoidsecurity vulnerability
Core Design Contradiction:
Adaptability or versatilityVSObject-affected harmful factors

Solution Approach 1:

The patent applies preliminary action by performing security validation before runtime execution. It checks for diamond inheritance patterns and validates offset relationships in advance, preventing hackers from exploiting offset manipulation to gain control. The system prepares security measures proactively rather than reactively.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent implements feedback mechanisms that monitor and validate offset usage during runtime. When polymorphic behavior is invoked, the system checks whether the offset points to a valid virtual base class and provides feedback to prevent exploitation. This continuous validation ensures that dynamic polymorphism remains secure.

Inventive Principle:
Principle #23Feedback

3Reliability

If virtual base classes are used to resolve diamond inheritance ambiguity, then language-level support is provided, but compiler implementation vulnerabilities remain exploitable

Engineering Contradiction:
Improveinheritance ambiguity resolutionVSAvoidcompiler implementation complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent replaces the mechanical compiler-level offset storage mechanism with a runtime validation system. Instead of relying solely on compiler-generated offset tables that can be exploited, the system substitutes a security layer that validates offset relationships during execution, reducing the attack surface while maintaining polymorphic functionality.

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

Solution Approach 2:

The patent changes the parameters of the inheritance system by introducing security checks that modify how offsets are validated. Rather than trusting compiler-generated offsets unconditionally, the system changes the validation parameter to include security checks that verify offset integrity, preventing exploitation while maintaining the virtual base class mechanism.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS8549544B1System, method and computer program product for preventing the execution of unwanted code
Publication Date: 2013.10.01 MCAFEE LLC
  • US8549544B1 patent drawing
  • US8549544B1 patent drawing
  • US8549544B1 patent drawing

AI summary

A system, method and computer program product are provided for preventing the execution of unwanted code. In use, it is determined whether an object is associated with a class having diamond inheritance. If it is determined that the object is associated with a class having diamond inheritance, an exploit of the object is prevented.