The repository of implementation for paper: Focus on Taint: LLM-Augmented Multi-Graphs for Vulnerability Detection and Analysis.
Large language models (LLMs) show promise in vulnerability reasoning through knowledge retrieval. However, direct application to source code is unreliable, as unconstrained token-level reasoning lacks structural understanding and often induces hallucinations—-issues especially acute for language-agnostic vulnerability knowledge. Existing approaches mainly rely on task-specific fine-tuning or text-based retrieval. While the former incurs prohibitive computational costs, the latter struggles to preserve semantic knowledge consistency across divergent programming languages.
To address these limitations, we propose
Create the Conda environment first,
conda env create -f environment.yml
conda activate lambdaCopy the example environment file .example.env and rename it to .env, and edit it to provide your LLM settings, e.g., API Key, base URL.
The datasets used in this work are hosted on Huggingface Repository, and it will automatically download when start the programs, so you need not download the datasets manually.
NOTICE: If you are in China mainland, accessing to huggingface needs the network proxy, you should set the following environments manually before getting start:
export HF_ENDPOINT=https://hf-mirror.com
The dataset is loaded directly from HuggingFace. Use --subset to choose a dataset config; the pipeline automatically loads the correct split (knowledge for building, inference for detection).
python build.py --subset js-to-cpp \
--language javascript \
[--reset-db] \
[--start N] \
[--limit N] \
[--workers N]Description of flags:
--subset NAMEDataset subset to load. Available:cpp-only,java-to-cpp,js-to-cpp,debug(default:js-to-cpp).--language LANGProgramming language for CPG generation (default:javascript). Supported:javascript,cpp,java,python. Should match the subset's language.--reset-dbDrop and re-create the ChromaDB collection before processing.--start NResume from row index N (0-based).--limit NStop after N samples.--workers NMax parallel LLM requests (default:LLM_MAX_WORKERSenv or 4).
Each knowledge entry is tagged with its subset in ChromaDB metadata, so different subsets' knowledge bases remain isolated. You can safely build multiple subsets into the same collection — queries filter by subset automatically.
python detect.py --subset js-to-cpp \
--language cpp \
[--start N] \
[--limit N] \
[--workers N]Description of flags:
--subset NAMEDataset subset to load (same options as above). Must match the subset used duringbuild.pyfor correct retrieval.--language LANGProgramming language for CPG generation (default:javascript). Should match the subset's language.--start NResume from row index N (0-based).--limit NStop after N samples.--workers NMax parallel LLM requests (default:LLM_MAX_WORKERSenv or 4).
Retrieval automatically filters ChromaDB by where={"subset": subset}, so only knowledge from the matching subset is used for RAG.
This work also used the following projects for secondary development. According to their open-source licenses, they will be described below.
Paper (ASE2023) | Project Repository
The CodeViews & Comex is a tree-sitter based tools to generate combined multi-code view graphs that can be used with various types of machine learning models (sequence models, graph neural networks, etc), released by IBM, authored by Das, Debeshee and Mathews, Noble Saji and Mathai, Alex and Tamilselvam, Srikanth and Sedamaki, Kranthi and Chimalakonda, Sridhar and Kumar, Atul.
Paper (ArXiv) | Project Repository | Presentation
The Atlas is the extended version of Comex. It's a command-line tool that takes one or more C or C++ source files and emits an AST, a source-level inter-procedural CFG, a reaching-definition DFG, or any combination. Authored by Jaid Monwar Chowdhury, Ahmad Farhan Shahriar Chowdhury, Humayra Binte Monwar, Mahmuda Naznin
The source code and programming implementation in this repository are licensed under the CC BY 4.0 License, align with the requests from AAAI official.
The datasets referenced or used by this project are NOT included under this license. All such datasets remain the intellectual property of their respective owners and are distributed under their own licenses, terms of use, and access conditions. Users are responsible for complying with the applicable licensing requirements of the original dataset providers when downloading, using, or redistributing these datasets.