1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Taint Analysis for Security Vulnerability Detection
//!
//! This module provides graph-based data flow analysis to trace potentially malicious
//! data from untrusted sources (user input) to dangerous sinks (SQL queries, shell commands, etc.).
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │ TaintAnalyzer │
//! │ - Defines sources (user input entry points) │
//! │ - Defines sinks (dangerous operations) │
//! │ - Defines sanitizers (functions that neutralize taint) │
//! └─────────────────────────────────────────────────────────────┘
//! │
//! ▼
//! ┌─────────────────────────────────────────────────────────────┐
//! │ trace_taint() │
//! │ - BFS through call graph from source functions │
//! │ - Track path through function calls │
//! │ - Identify when tainted data reaches a sink │
//! └─────────────────────────────────────────────────────────────┘
//! │
//! ▼
//! ┌─────────────────────────────────────────────────────────────┐
//! │ TaintPath │
//! │ - Source function (where taint originates) │
//! │ - Sink function (dangerous operation) │
//! │ - Call chain (functions between source and sink) │
//! │ - Sanitized flag (whether sanitizer was in path) │
//! └─────────────────────────────────────────────────────────────┘
//! ```
//!
//! # Usage
//!
//! ```ignore
//! use repotoire_cli::detectors::taint::{TaintAnalyzer, TaintCategory};
//!
//! let analyzer = TaintAnalyzer::new();
//! let paths = analyzer.trace_taint(&graph, TaintCategory::SqlInjection);
//!
//! for path in paths {
//! if !path.is_sanitized {
//! // Critical: unsanitized taint flow to SQL sink
//! }
//! }
//! ```
pub use *;
pub use *;
pub use CentralizedTaintResults;