Abstract
Currently, code review and white-box security detection are widely used to parse source code and discover security vulnerabilities. In this paper, we illustrate a more accurate code security review method based on a "reference tree" with security properties derived from all manipulable entries in the source code. This method can greatly reduce false positives and provides a superior solution for automated secure reviewing by focusing exclusively on exploitable security flaws.
Introduction
Static analysis and code review are essential for identifying vulnerabilities like SQL injection and buffer overflows before software deployment. However, current tools often face a "precision vs. scalability" trade-off. Lexical scanners are fast but frequently flag dangerous functions regardless of reachability, leading to excessive false positives. Conversely, model checkers are precise but computationally expensive and often require manual code annotation.
This paper proposes a novel automated method that bridges this gap by focusing on exploitable flaws—vulnerabilities that can actually be reached or manipulated by external inputs. By building reference trees from user-controllable inputs and applying Formulated Security Restrictions (FSR), the system identifies vulnerabilities through property conflicts between parent and child nodes.
Methodology and System Architecture
The proposed system architecture is designed around four primary modules that automate the discovery and remediation of security "holes."
- Manipulable Entry Locator: The system identifies all points where external data enters the program (e.g.,
scanf(),Getchar(), or network socket APIs). These serve as the roots for potential exploits. - Parse Engine: Using compiler technologies, the engine constructs a Reference Tree for each entry, mapping every part of the code influenced by the input data.
- Holes Detector: Each node in the tree is assigned Formulated Security Restrictions (FSR)—machine-readable properties like regular expressions. The detector traverses the tree to find conflicts. For instance, if a parent node allows any string length but a child node (a buffer) only allows 20 characters, a potential buffer overflow is flagged.
- Warning & Repair Generator: Upon finding a conflict, the system generates a warning and suggests specific fixes, such as adding string validation at a specific point in the data flow.
Key Insights
- Exploitability as a Filter: By starting analysis at the input layer and tracing forward, the tool avoids wasting resources on unreachable code paths, significantly reducing noise.
- FSR as a Universal Language: Formulated Security Restrictions allow the system to handle diverse vulnerabilities (SQLi, XSS, Buffer Overflows) using a unified logic: checking for consistency between data source properties and data sink requirements.
- Automated Repair Advice: Because the system understands the hierarchical relationship between nodes, it can pinpoint exactly where a validation check is missing and suggest specific parameters (e.g., "limit input to 20 characters here").
Case Studies and Results
The paper demonstrates the method's efficacy through qualitative walkthroughs of common vulnerability scenarios:
- Code Injection (SQLi): The system identifies instances where a parent node allows SQL meta-characters (like
'or--) while the child node (the database query) requires them to be stripped. - Buffer Overflow: The system detects length mismatches across the data flow. As shown in the reference tree below, if a parent node allows more data than its children can handle, the system flags the specific node requiring a fix.
While the paper claims the method "greatly reduces false positives" and "reduces parse overhead," it focuses on the architectural framework rather than providing quantitative benchmark comparisons against legacy tools.
Limitations and Future Work
Despite its promise, the method has several areas for further development. The paper lacks detail on the specific compiler technologies used to build reference trees and the automation level of FSR assignment during parsing. Additionally, while the authors suggest applying this to "Privilege Elevation" and "Data Tampering" using Access Control Lists (ACLs), these complex logical flaws require more detailed workflows. Future research should include empirical validation against industry-standard static analysis security testing (SAST) tools to quantify efficiency gains.
Summary updated