TL;DR
This paper introduces AlphaEXP, an expert system designed to automatically identify and classify security-sensitive kernel objects in the Linux kernel. By simulating an adversary's thought process and building a knowledge graph of the kernel, AlphaEXP can pinpoint objects that, if compromised, could lead to significant security breaches, helping defenders prioritize their efforts.
What Problem Does This Paper Address?
Modern operating systems, particularly the Linux kernel, are complex and contain numerous objects that, if manipulated by an attacker, can lead to severe security vulnerabilities like privilege escalation or information leakage. While some security mechanisms exist to protect critical objects, identifying which objects are truly security-sensitive and how sensitive they are remains a significant challenge. Existing methods often rely on analyzing known exploits, which misses potential future threats, or are too broad, leading to performance overhead. This paper aims to bridge this gap by providing a systematic and automated way to identify and rank the sensitivity of kernel objects.
Methods
AlphaEXP employs a three-module approach inspired by human expert reasoning:
- Knowledge Graph Construction: This module builds a comprehensive representation of the Linux kernel. It involves:
- Ontology Construction: Defining the types of entities (objects, functions, etc.) and their relationships.
- Knowledge Extraction: Using both static analysis (parsing LLVM IR) and dynamic analysis (fuzzing with Syzkaller) to populate the knowledge graph with facts about kernel structures, functions, and their interactions, especially those involving userland operations.
- Attack Path Generation: This module simulates an adversary's process of finding attack paths. It uses the knowledge graph to:
- Attack Action Selection: Heuristically choosing userland operations that could lead to capability upgrades.
- Inference: Employing a Datalog-based engine to deduce the effects of these actions on memory states and unintended capabilities (reading, writing, execution).
- Scheduling: Iteratively exploring potential attack paths, prioritizing those that lead to capability upgrades, until a complete exploit path is found.
- Sensitive Object Classification: Once an object is identified as being part of a potential attack path, this module classifies its sensitivity. It considers:
- Applied Conditions: How easy it is to use the object in an exploit (e.g., kmem-cache requirements, entry capability needs, vulnerability type).
- Effect Achieved: The impact of abusing the object on unintended capabilities (e.g., upgrading reading, writing, or execution capabilities).
Datasets
- Synthesized Vulnerabilities: 84 synthesized representative vulnerabilities were created to test AlphaEXP. These cover various types like Use-After-Free (UAF) and buffer overflows, with different entry capabilities and kmem-cache hosting vulnerable objects.
- Real-world Vulnerabilities: 19 real-world CVEs from the past five years were used, focusing on UAF and heap buffer overflows with public exploits.
Key Insights and Ideas
- Simulating Adversarial Thinking: The core idea of mimicking an expert's thought process—building knowledge, exploring attack paths, and assessing impact—is a powerful way to automate security analysis.
- Knowledge Graph as a Foundation: A detailed knowledge graph of the kernel is crucial for understanding complex interactions and inferring potential exploitability.
- Sensitivity is Multi-faceted: An object's sensitivity isn't just about whether it can be abused, but how easily and with what impact. AlphaEXP's classification system captures this nuance.
- UAFs are Easier to Exploit: The study found that UAF vulnerabilities are generally easier to exploit than buffer overflows because they allow for more direct manipulation of adjacent memory objects and their pointers.
- AAW is Harder than ACE: Achieving arbitrary write (AAW) capabilities is more challenging than arbitrary code execution (ACE) because kernel objects suitable for AAW often have fixed lengths and less controllable pointer placements.
Key Results
- AlphaEXP successfully identified sensitive objects for most of the 84 synthesized and 19 real-world vulnerabilities.
- It found 50 objects that could be abused for writing capability, 81 for reading, and 112 for execution.
- These objects were classified into 12 distinct sensitivity levels based on applied conditions and achieved effects.
- The system achieved a low false positive rate (3 out of hundreds of identified objects) after dynamic verification.
- AlphaEXP outperformed existing state-of-the-art methods (SLAKE, KOOBE, ELOISE) by identifying more sensitive objects and providing sensitivity classification.
- The knowledge graph construction took 19 minutes for static analysis and 72 hours for dynamic analysis, resulting in over 100,000 entities and 180,000 relationships.
Limitations and Future Work
- Soundness: While AlphaEXP identifies objects that can facilitate capability upgrades, it doesn't fully guarantee the effectiveness of the generated attack paths in real-world exploits, as generating actual exploits is beyond its scope. Future work could automate this evaluation.
- Completeness: The system relies on target vulnerabilities and fuzzing for knowledge extraction, which might miss some potential attack paths or sensitive objects. Improving fuzzing techniques (e.g., directed greybox fuzzing) and expanding the rule sets for inference are suggested.
- Knowledge Graph Expansion: The current knowledge graph could be enhanced by including information about function sanitization.
- Generalization: The attack action selection heuristic could be improved by incorporating learned experience from previous selections.
- Automated Exploit Generation (AEG): AlphaEXP's approach offers a promising direction for AEG by providing a structured way to generate exploit plans, which could be further refined.
- Broader Application: The knowledge graph approach could be extended to analyze userland software.
Summary updated