Multi-Level Code Representation for Cross-Language SAST Analysis
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing static application security testing (SAST) tools face challenges in creating a universal intermediate level representation that is versatile, simple, natural, and preserves structure across diverse programming languages, leading to complexity and difficulty in understanding and maintaining SAST algorithms.
Innovation Solution
Implementing multiple source code representations for SAST, including programming language-specific and generalized intermediate levels, and a generalized lower level representation, adapted for structural and dataflow analysis, leveraging the MLIR compiler framework to facilitate conversion and analysis across various programming languages.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If a universal intermediate level representation is created for SAST across diverse programming languages, then compatibility and versatility are improved, but device complexity and difficulty of understanding increase
Solution Approach 1:
The patent segments the intermediate representation into multiple hierarchical levels (high-level IR preserving source code structure, low-level IR simplifying dataflow analysis). This segmentation allows each level to specialize in specific analysis tasks, reducing overall algorithmic complexity while maintaining multi-language compatibility through standardized conversion paths.
Solution Approach 2:
The patent introduces a standardized intermediate representation format that acts as an intermediary between diverse programming languages and the SAST analysis engine. This mediator IR layer provides language-agnostic structures that simplify the analysis algorithms while preserving essential program semantics, thereby reducing complexity without sacrificing versatility.
2Measurement precision
If structural features are preserved in intermediate representation for analysis, then structural analysis accuracy is improved, but dataflow analysis complexity increases
Solution Approach 1:
The patent divides the intermediate representation into structural components (preserving source code hierarchy for accurate structural analysis) and dataflow components (simplified representations for efficient dataflow analysis). This segmentation allows both types of analysis to operate on optimized representations, improving structural accuracy while reducing dataflow complexity.
Solution Approach 2:
The patent applies different representation qualities to different parts of the analysis pipeline: high-fidelity structural representations are used where structural accuracy is critical, while simplified representations are used where dataflow analysis is performed. This local optimization of representation quality improves structural analysis without unnecessarily complicating dataflow analysis.
3Reliability
If multiple source code representations are implemented for different analysis types, then analysis effectiveness is improved, but converter development complexity increases
Solution Approach 1:
The patent designs a universal intermediate representation framework that can serve multiple analysis purposes (structural analysis, dataflow analysis, security vulnerability detection). This multi-functional IR system reduces the need for separate converters for each analysis type, as a single IR conversion pipeline can feed multiple analysis engines, thereby improving effectiveness while reducing converter development complexity.
Solution Approach 2:
The patent segments the conversion process into standardized phases (parsing, intermediate representation generation, analysis-specific transformation) that can be reused across different programming languages and analysis types. This modular segmentation of the conversion pipeline reduces overall complexity by allowing individual components to be developed and maintained independently.
Data Source
AI summary
Source code in a programming language is received. The source code is converted to a generalized intermediate level representation not specific to any programming language. The source code is converted from the generalized intermediate level representation to a generalized lower level representation adapted to a dataflow analysis portion of static application security testing (SAST). The generalized lower level representation is also not specific to any programming language.


