Context-Free String Analysis for Static Code Defect Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional string analysis techniques model strings as regular expressions, which are not computed efficiently, leading to inefficiencies in identifying potentially malicious input and reducing false positive reports due to the failure to consider sanitization of string values.

Innovation Solution

A method and system for performing static analysis by extracting context-free inter-procedural and context-sensitive parameter mapping rules from caller and callee functions, deriving values for callsites, and identifying defects using these rules to contextualize input parameters and return values.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional string analysis techniques model strings as regular expressions, then string analysis can be performed, but the computation is not efficient

Engineering Contradiction:
Improvestring analysis precisionVSAvoidcomputation efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent changes the fundamental parameter of string representation from regular expressions to context-free grammars with context-sensitive parameter mapping rules. This transformation enables more efficient computation while maintaining or improving analysis precision by allowing systematic derivation of string values through grammar rules rather than complex regular expression matching.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent segments the string analysis process into distinct components: context-free grammar rules for structural analysis and context-sensitive parameter mapping rules for value derivation. This segmentation allows each component to be optimized independently, improving overall computational efficiency while maintaining analysis accuracy.

Inventive Principle:
Principle #1Segmentation

2Reliability

If conventional string analysis techniques are used, then analysis can be performed, but false positive reports increase due to failure to consider sanitization of string values

Engineering Contradiction:
Improveanalysis accuracyVSAvoidfalse positive reports
Core Design Contradiction:
ReliabilityVSObject-generated harmful factors

Solution Approach 1:

The patent applies preliminary action by deriving string values at callsites before they are used in security-critical operations. By using context-sensitive parameter mapping rules to trace and derive the actual values of parameters at each callsite, the system can identify sanitized values in advance, preventing false positive security reports while maintaining high analysis accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent implements feedback mechanisms through context-sensitive parameter mapping that traces parameter values through function calls and updates the analysis based on actual runtime values. This feedback loop allows the system to learn from sanitization operations and adjust its analysis accordingly, reducing false positives while maintaining reliability.

Inventive Principle:
Principle #23Feedback

3Measurement precision

If precise string analysis is performed to identify defects, then security vulnerabilities can be detected, but the analysis does not scale efficiently

Engineering Contradiction:
Improvedefect identification precisionVSAvoidanalysis scalability
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent creates a universal framework using context-free grammars that can analyze multiple types of code structures and string operations through a single set of derivation rules. This universal approach maintains precise defect identification across diverse codebases while improving scalability by avoiding the need for separate analysis mechanisms for different code patterns.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS10719424B1Compositional string analysis
Publication Date: 2020.07.21 ORACLE INT CORP
  • US10719424B1 patent drawing
  • US10719424B1 patent drawing
  • US10719424B1 patent drawing

AI summary

A method for performing a static analysis may include extracting, from a caller function in code, a context-free inter-procedural rule including a callsite and a return value of a callee function. The callsite may invoke the callee function. The method may further include extracting, from the caller function, a context-sensitive parameter mapping rule that maps an input parameter of the callee function to an invocation value provided by the caller function at the callsite, deriving a derived value for the callsite using the context-free inter-procedural rule and the context-sensitive parameter mapping rule, and identifying a defect in the code by performing the static analysis using the derived value for the callsite.