Second-Order Taint Analysis for Library Vulnerability Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional flow-sensitive whole-program static analysis fails to detect second-order security vulnerabilities in library code due to the absence of direct control flow between different library functions, which are common in scenarios involving tainted data storage and retrieval.

Innovation Solution

A method is introduced to perform second-order taint analysis by generating execution paths from load and store instructions using first-order taint analysis, forming potential second-order taint flows by joining these paths, and optimizing the process to reduce execution time by precomputing taint flows.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional flow-sensitive whole-program static analysis is used to analyze library code, then the analysis follows direct control flow paths, but it fails to detect second-order security vulnerabilities where no direct control flow exists between library functions

Engineering Contradiction:
Improvedetection accuracyVSAvoidanalysis complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the taint analysis into two distinct phases: first-order taint analysis that follows direct control flow paths, and second-order taint analysis that reconstructs indirect data flows through global identifiers. This segmentation allows the system to maintain the simplicity of conventional analysis while adding the capability to detect second-order vulnerabilities through a separate, targeted analysis pass that specifically addresses indirect data flows.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a new dimension to the analysis by moving from solely control-flow-based analysis to include data-flow reconstruction through global identifier matching. This dimensional shift enables the detection of second-order vulnerabilities by analyzing data dependencies that exist outside the traditional control flow structure, thereby detecting vulnerabilities that conventional single-dimension analysis misses.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Measurement precision

If second-order taint analysis reconstructs indirect data flows through global identifiers, then detection capability improves, but execution time increases due to path generation and joining operations

Engineering Contradiction:
Improvevulnerability detection capabilityVSAvoidanalysis execution speed
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent performs preliminary action by pre-computing and storing first-order taint analysis results before conducting the second-order analysis. This preliminary computation of direct data flows creates a foundation that accelerates the subsequent indirect flow reconstruction, as the system can leverage pre-analyzed taint information rather than performing redundant analysis during the second-order phase.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses copying by creating execution path representations that can be reused and combined. Instead of re-analyzing the same code segments multiple times, the system generates path representations from the first-order analysis and copies/reuses these representations during second-order analysis, significantly reducing the computational overhead of path generation and joining operations.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS11586740B2Detecting second-order security vulnerabilities in libraries
Publication Date: 2023.02.21 ORACLE INT CORP
  • US11586740B2 patent drawing
  • US11586740B2 patent drawing
  • US11586740B2 patent drawing

AI summary

A method for executing a second-order taint analysis on library code may include generating, by executing a first-order taint analysis on the library code starting at a sink, a first execution path from a load instruction to the sink. The load instruction may perform: reading a first value using a first global identifier. The method may further include determining a store instruction by matching the load instruction and the store instruction. The store instruction may perform: writing a second value using a second global identifier. The method may further include, generating a second execution path from the store instruction to the load instruction, generating, by executing the first-order taint analysis on the library code starting at the store instruction, a third execution path from an entry point to the store instruction, and forming a potential second-order taint flow by joining the first, second, and third execution paths.