Feedback-Directed Static Analysis for Node.js Module Precision

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Static dataflow analysis techniques, such as abstract interpretation, are insufficiently precise for dynamic programming languages like JavaScript due to coarse-grained abstractions and do not scale well to large codebases, particularly in Node.js applications with numerous NPM modules.

Innovation Solution

A feedback-directed static analysis method that iteratively updates the list of to-be-analyzed modules by assigning abstract values and tags, allowing for over-approximation of modules to improve efficiency and scalability without sacrificing precision, and uses tags to track information about over-approximated values and their impact on analysis precision.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If abstract interpretation techniques are used to improve precision, then measurement precision is improved, but productivity deteriorates due to slow analysis speed and poor scalability to large codebases

Engineering Contradiction:
Improveanalysis precisionVSAvoidanalysis speed
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent segments the codebase into modules and introduces a feedback-directed analysis mechanism that selectively applies precise abstract interpretation only to relevant modules. The system maintains a worklist of modules to be analyzed and processes them in iterations, applying full precision only when necessary based on feedback from previous analysis rounds, rather than uniformly analyzing all modules with high precision.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements partial action by analyzing only the subset of modules that are necessary for detecting specific vulnerabilities. The feedback-directed approach identifies which modules require precise analysis based on their relevance to the analysis goal, applying abstract interpretation selectively rather than to the entire codebase, thus reducing overall analysis time while maintaining precision where needed.

Inventive Principle:
Principle #16Partial or excessive action

2Productivity

If coarse-grained abstractions are used to improve scalability, then productivity is improved, but measurement precision deteriorates making the analysis insufficiently useful

Engineering Contradiction:
ImprovescalabilityVSAvoidanalysis precision
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent applies local quality by using different levels of abstraction granularity in different parts of the codebase. Highly precise abstract interpretation is applied locally to specific modules identified as relevant through the feedback mechanism, while other modules may receive coarser analysis or be skipped entirely. This allows the system to achieve high precision where it matters most while maintaining scalability overall.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS10783245B2Feedback-directed static analysis
Publication Date: 2020.09.22 ORACLE INT CORP
  • US10783245B2 patent drawing
  • US10783245B2 patent drawing
  • US10783245B2 patent drawing

AI summary

A method may include obtaining a list of to-be-analyzed modules of an application. The list of to-be-analyzed modules may include a first module including a statement. The method may further include generating initial results by performing an initial iteration of a static analysis that analyzes each module in the list of to-be-analyzed modules, determining, by the initial iteration, that the statement is a function call to a second module not in the list of to-be-analyzed modules, in response to the determination, assigning, by the initial iteration, an abstract value to a memory address associated with the statement, adding, to the abstract value, a tag including a name of the second module, updating, using the tag and the initial results, the list of to-be-analyzed modules, and generating next results by performing a next iteration of the static analysis that analyzes each module in the updated list of to-be-analyzed modules.