A taint analysis engine for identifying source-to-sink vulnerability flows
Project description
๐ Tainter
A taint analysis engine for identifying source โ sink vulnerability flows in real-world codebases.
Features
- Inter-procedural analysis: Track taint across function boundaries and multiple files
- Multi-language parsing: Parse Python and Java source trees
- Language auto-selection: Count
py/java/js/gofiles and activate analyzers from project composition - Framework-aware: Built-in support for Flask, Django, FastAPI, and CLI applications
- Extensible models: Define custom sources, sinks, and sanitizers
- Multiple reporters: Console, JSON, and SARIF output with flow explanations
Current status: Python and Java taint-flow detection are wired. JavaScript and Go are counted for auto-selection but analyzer implementations are not wired yet.
Vulnerability Classes
Tainter detects flows leading to:
| Class | Description |
|---|---|
| SQLi | SQL Injection via unsanitized database queries |
| RCE | Remote Code Execution via eval, exec, os.system, etc. |
| SSTI | Server-Side Template Injection |
| SSRF | Server-Side Request Forgery |
| Deserialization | Unsafe deserialization via pickle, yaml.load, etc. |
| Path Traversal | Unvalidated file path operations |
Installation
pip install tainter
Or for development:
git clone https://github.com/your-org/tainter.git
cd tainter
pip install -e ".[dev]"
Quick Start
# Scan a Python project
tainter scan /path/to/project
# Scan with specific vulnerability focus
tainter scan /path/to/project --vuln-class sqli --vuln-class rce
# Scan only Java files
tainter scan /path/to/project --language java
# Scan only JavaScript/Go inventory (will report no active analyzer yet)
tainter scan /path/to/project --language js --language go
# Output in SARIF format
tainter scan /path/to/project --format sarif -o results.sarif
How It Works
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โ Sources โโโโโถโ Taint โโโโโถโ Flow โโโโโถโ Report โ
โ (input) โ โ Tracker โ โ Finder โ โ Builder โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โ โ โ โ
โผ โผ โผ โผ
request.args propagate find paths JSON/SARIF
input() across to sinks with context
os.environ functions
Example Output
{
"flows": [
{
"id": "FLOW-001",
"vulnerability_class": "sqli",
"confidence": 0.95,
"source": {
"file": "app/routes.py",
"line": 15,
"code": "user_id = request.args.get('id')"
},
"sink": {
"file": "app/db.py",
"line": 42,
"code": "cursor.execute(f\"SELECT * FROM users WHERE id = {user_id}\")"
},
"call_chain": [
"routes.get_user()",
"db.fetch_user(user_id)"
],
"variable_path": ["user_id", "id_param", "query"]
}
]
}
Architecture
Tainter is built with separation of concerns:
- Parser: AST-based Python parsing
- Graph Builder: Call graph and data flow graph construction
- Models: Extensible source/sink/sanitizer definitions
- Analyzer: Taint propagation with inter-procedural flow tracking and basic branch handling
- Reporter: Multiple output formats
Configuration
Built-in sources, sinks, and sanitizers are available by default. Project-local model configuration is not implemented yet.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tainter-1.0.2.tar.gz.
File metadata
- Download URL: tainter-1.0.2.tar.gz
- Upload date:
- Size: 100.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9f772228b0367137441b54cbd2b7da5ae5b0682c98fa3f2ea7c269c902bae04
|
|
| MD5 |
10dbfd0c40d79bd6679756f29f104228
|
|
| BLAKE2b-256 |
9bc595b03c0ddfedaf1b57162c8ffa5f9079280f6677031f5681e23e8af82056
|
Provenance
The following attestation bundles were made for tainter-1.0.2.tar.gz:
Publisher:
python-publish.yml on ihrishikesh0896/tainter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tainter-1.0.2.tar.gz -
Subject digest:
a9f772228b0367137441b54cbd2b7da5ae5b0682c98fa3f2ea7c269c902bae04 - Sigstore transparency entry: 1387978345
- Sigstore integration time:
-
Permalink:
ihrishikesh0896/tainter@8d40b5c089f6d820e040b9d57829a26141db4247 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/ihrishikesh0896
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8d40b5c089f6d820e040b9d57829a26141db4247 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tainter-1.0.2-py3-none-any.whl.
File metadata
- Download URL: tainter-1.0.2-py3-none-any.whl
- Upload date:
- Size: 80.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adcaa71a749d9383a5bf8dd892b948328d17ddf184907a91938f8fbe3f1509d5
|
|
| MD5 |
022cd63fdee9dc48828e8de23df0a2d8
|
|
| BLAKE2b-256 |
ebc1dbc20e57c596b82a4f8ebf53722b46f32cf8ffb4589970886a20f6ed320b
|
Provenance
The following attestation bundles were made for tainter-1.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on ihrishikesh0896/tainter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tainter-1.0.2-py3-none-any.whl -
Subject digest:
adcaa71a749d9383a5bf8dd892b948328d17ddf184907a91938f8fbe3f1509d5 - Sigstore transparency entry: 1387978443
- Sigstore integration time:
-
Permalink:
ihrishikesh0896/tainter@8d40b5c089f6d820e040b9d57829a26141db4247 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/ihrishikesh0896
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8d40b5c089f6d820e040b9d57829a26141db4247 -
Trigger Event:
release
-
Statement type: