Skip to main content

🔍 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/go files 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

Metadata

Release files for tainter 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tainter 1.0.2
File Size Uploaded Provenance Actions
tainter-1.0.2.tar.gz 100.7 kB With provenance Details for tainter-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tainter 1.0.2
File Interpreter ABI Platform Actions
tainter-1.0.2-py3-none-any.whl Python 3 none any Details for tainter-1.0.2-py3-none-any.whl

Total release size: 181.1 kB

Release files / tainter-1.0.2.tar.gz

Download URL tainter-1.0.2.tar.gz
Size 100.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a9f772228b0367137441b54cbd2b7da5ae5b0682c98fa3f2ea7c269c902bae04
BLAKE2b-256 checksum
How to use checksums
9bc595b03c0ddfedaf1b57162c8ffa5f9079280f6677031f5681e23e8af82056
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.

Transparency log

Release files / tainter-1.0.2-py3-none-any.whl

Download URL tainter-1.0.2-py3-none-any.whl
Size 80.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adcaa71a749d9383a5bf8dd892b948328d17ddf184907a91938f8fbe3f1509d5
BLAKE2b-256 checksum
How to use checksums
ebc1dbc20e57c596b82a4f8ebf53722b46f32cf8ffb4589970886a20f6ed320b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.

Transparency log

Security for tainter 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tainter-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page