An Advanced Graph Neural Network (GNN) based Static Application Security Testing (SAST) Tool
GNNspector is a next-generation AI-driven static analysis tool engineered to detect vulnerabilities (such as Buffer Overflows, Command Injections, etc.) in source code. Instead of relying on traditional regular expressions (Regex), it parses source code into structured Abstract Syntax Trees (AST) using Tree-sitter, generates deep semantic node features via Microsoft CodeBERT, and utilizes a custom Graph Neural Network (GCN) architecture to classify files as Safe or Vulnerable.
Post-detection, it routes the telemetry to a hybrid LLM core (Cloud / Local Ollama) to generate a full remediation report and initiates an interactive security assistant patch loop directly inside your terminal.
To ensure the scanner operates correctly, your environment must satisfy the following system and software requirements:
- Python 3.10 or higher must be installed on your system.
- Pip (Python Package Manager) should be updated to the latest version.
The engine utilizes Ollama for hosting local LLMs to guarantee data privacy during code audits.
- Install Ollama: Download and install the application for your operating system from the Official Ollama Website.
- Pull the DeepSeek Model: Open your terminal or command prompt and execute the following command (this is mandatory for the offline pipeline):
Run this single command to download and install Ollama automatically:
curl -fsSL https://ollama.com/install.sh | shTo run the model, use:
ollama run deepseek-coder:1.3b- Direct Download Link: Download Ollama for Windows
- Step: Run the downloaded
OllamaSetup.exefile and click Install.
Follow these steps to set up the environment and install GNNspector:
# Update system and install dependencies
sudo apt-get update
sudo apt-get install build-essential python3-dev
# Clone the repository and navigate inside
git clone https://github.com/bkshukla91/GNNspector.git
cd GNNspector
# Install Python requirements
pip install -r requirements.txt
pip install -e .
# [OPTIONAL] Set up cloud API key if local Ollama/DeepSeek is not working
OPENROUTER_API_KEY="your_actual_api_key_here"
# Run GNNspector
gnnspector path/to/your/target_code.cThis architecture is distributed under the MIT License - see the LICENSE file for open-source compliance details.
- 👨💻 Author: Balkrishna Shukla
- 🏫 Affiliation: Cyber Security Branch, Engineering College Ajmer (ECA)