Skip to main content

A plugin-driven, multi-language SAST.

Project description

DRSource

DRSource is a professional, extensible, multi-language Static Application Security Testing (SAST) tool. It combines high-speed regex pattern matching with advanced AST-based Inter-File Taint Analysis to identify complex vulnerabilities across entire codebases.

DRSource doesn't just look for "bad strings"; it understands the data flow of your application, tracking user input from entry points (Sources) through logic layers, respecting sanitization functions (Sanitizers), until it reaches dangerous execution points (Sinks).

Key Features

  • Advanced Inter-File Taint Analysis (v0.102.0): Tracks data flow across different files and modules. It can follow a tainted variable from a web controller in one file to a database helper in another.
  • Context-Aware Precision:
    • Scope Management: Understands local and global scopes, preventing variable name collisions between functions.
    • AST Sanitizers: Recognizes security controls (e.g., escape(), prepareStatement, int()). If data is cleaned, the alert is suppressed, drastically reducing false positives.
    • Sink Argument Tracking: Only flags a vulnerability if the tainted data reaches a specific, dangerous argument of a function (e.g., the query string in db.execute(), but not the parameters list).
  • Multi-Engine Analysis:
    • Tree-sitter Powered: Uses industrial-grade parsers for Java and JavaScript/TypeScript for robust analysis of modern syntax.
    • Native Python AST: Deep integration with Python's native AST for precise data-flow tracking.
    • Regex Engine: High-entropy secret scanning (AWS, GitHub, Stripe) and legacy pattern detection.
  • Professional Knowledge Base: Highly configurable YAML-based rules engine with support for configuration overlays (Default, User, Project, CLI).
  • SARIF Support: Export results in the standard format for integration with GitHub Security Tab, GitLab, or SonarQube.

Supported Languages & Frameworks

  • Java: Spring, Servlets, JDBC.
  • Python: Flask, Django, standard library.
  • JavaScript/TypeScript: Node.js (Express), Sequelize, Prisma, Axios, Browser-side JS.

Knowledge Base Example

DRSource uses a professional schema to define vulnerabilities:

SQL_INJECTION:
  description: "Building SQL queries with unvalidated user input."
  severity: "HIGH"
  language_specific:
    javascript:
      ast_sources: ["req.query", "req.body"]
      ast_sinks: 
        - name: "db.query"
          args: [0] # Only the first argument is vulnerable
      ast_sanitizers: ["escape", "validator.escape"]

Installation

Clone the repository and install in editable mode:

git clone https://github.com/thesp0nge/dr_source.git
cd dr_source
pip install --editable .

Usage

# Standard scan of a directory
dr_source /path/to/codebase

# View full data-flow traces (including inter-file hops)
dr_source --show-trace /path/to/codebase

# Export to SARIF for CI/CD integration
dr_source --export sarif --output report.sarif /path/to/codebase

# Initialize or reset the local scan database
dr_source --init-db /path/to/codebase

Configuration Overlays

Rules are prioritized from highest to lowest:

  1. CLI Override: --config /path/to/rules.yaml
  2. Project Local: ./.dr_source_rules.yaml
  3. User Home: ~/.config/dr_source/knowledge_base.yaml
  4. Factory Default: Internal ruleset.

License

DRSource is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dr_source-0.102.0.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dr_source-0.102.0-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file dr_source-0.102.0.tar.gz.

File metadata

  • Download URL: dr_source-0.102.0.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for dr_source-0.102.0.tar.gz
Algorithm Hash digest
SHA256 8dae13799dbb70dc15560c54c411edaf959acf8e496f3d8f0bf3291239c02dda
MD5 43034c84ad5814eff7b85ec6ccf49916
BLAKE2b-256 6c1fd5c093bd031f147867cdd85737874dd94aed559fa1c55c4cea363e292e8e

See more details on using hashes here.

File details

Details for the file dr_source-0.102.0-py3-none-any.whl.

File metadata

  • Download URL: dr_source-0.102.0-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for dr_source-0.102.0-py3-none-any.whl
Algorithm Hash digest
SHA256 870f79922cd8a5385441d23b6999fc0e96b5f83c3fbbcca12c5c503e16e7b300
MD5 0c0d7153ae15f39c59bb7f3cff34a72c
BLAKE2b-256 7597d3fe75f1d92e02cb8b1bdca58151895adc030b525e9da33306af6799cd96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page