How wh1t3p1g/tabby works
Project Type and Purpose
• This is an open-source static code analysis tool for Java (Tabby).
• It ingests JAR/WAR/CLASS files, builds a Code Property Graph (CPG) via Soot, and stores it in Neo4j for vulnerability hunting.
Main Components
a. Entry Point / CLI
• App.java / run.sh – command-line launcher
b. Configuration Layer
• GlobalConfiguration, SootConfiguration, AsyncConfiguration
• application.properties, settings.properties
c. File Collection & Scanning
• FileCollector → ClassInfoCollector → CallGraphCollector
• Uses Soot under the hood
d. Analysis Engine
• Core.Analysis (ActionWorker, SimpleTypeAnalysis)
• Analysis.Helper (SemanticHelper)
• Analysis.Switchers & PTA switchers (StmtSwitcher, TValueSwitcher)
• Model builders (CallEdgeBuilder, InvokeModel implementations)
e. Rule Engine
• JSON rule files (rules/*.json)
• TabbyRule, TagRule, XmlRule classes
f. Data Containers
• DataContainer (holds intermediate objects: ValueContainer, SimpleObject, MultiObject)
• RulesContainer (loaded rules)
g. Persistence Layer
• DAL.Repositories (AliasEdgeRepository, CallEdgeRepository, ClassRepository, etc.)
• DAL.Services (RelationshipsService, ClassRefService, MethodRefService)
• Neo4j graph database (external service)
h. Plugin Framework
• Plugins for jmod, jsp, xml (transfer, compile, parse)
• Extension points for additional file formats
i. External Dependencies
• Soot (static analysis)
• Neo4j + Cypher (graph storage & traversal)
Relationships & Data Flow
• Start: CLI/App reads Configuration → loads Rules from JSON
• FileCollector scans input artifacts → hands off to ClassInfoCollector
• CallGraphCollector uses Soot to build call graph, CPG nodes & edges
• Analysis Engine consumes CPG via Switchers & Models → populates DataContainer
• Rule Engine matches analysis results against loaded rules
• Findings & CPG are persisted using DAL.Repositories into Neo4j
• Neo4j’s path-finding extension serves advanced taint/vulnerability queries
• Plugins can inject pre-processing or additional graph data
Architectural Patterns & Principles
• Pipeline / staged processing (collector → scanner → analyzer → persister)
• Plugin-based extensibility (jmod, jsp, xml)
• Dependency inversion: core modules depend on abstractions (interfaces for models, repositories)
• Configuration-driven behavior (Spring Boot style, asynchronous tasks)
Detailed Callouts
• That Configurations drive Soot setup and async threading
• That DataContainer aggregates intermediate graph objects before persistence
• That Neo4j’s path finder extension executes Cypher queries for taint analysis
• Plugin interfaces clearly so new file-type parsers can be slotted in