Skip to main content

osvcheck

Python Tests PyPI version Python versions Downloads Security Maintenance

Lightweight vulnerability scanner for Python dependencies using the OSV database.

osvcheck scans your Python project's dependencies for known security vulnerabilities by querying the OSV (Open Source Vulnerabilities) database. It's designed for source-level checking during development and CI/CD pipelines.

Key features:

  • Zero runtime dependencies (stdlib only)
  • Auto-detects package manager (uv.lock, uv, or pip)
  • Smart caching (12-48 hour TTL) minimizes API calls
  • Distinguishes direct vs indirect vulnerabilities
  • Optional rich integration for enhanced output (auto-detected if installed)

Installation

Install via pip or uv, or add to your project's dev dependencies.

Usage

# Scan current project
osvcheck

# Scan a specific interpreter or virtual environment
osvcheck --python /path/to/python
osvcheck --venv /path/to/virtualenv

# Logging options
osvcheck -v              # Verbose (debug) output
osvcheck -q              # Quiet (warnings/errors only)
osvcheck --log-json      # JSON format logs
osvcheck --log-file FILE # Write logs to file

# Color control
osvcheck --color         # Force color output
osvcheck --no-color      # Disable color output

Exit codes:

  • 0 - No vulnerabilities found
  • 1 - Indirect dependency vulnerabilities only
  • 2 - Direct dependency vulnerabilities found

As a Pre-commit hook:

Add to .pre-commit-config.yaml:

- repo: https://github.com/deeprave/osvcheck
  rev: v1.0.1
  hooks:
    - id: osvcheck

CI/CD integration:

# Fail only on direct vulnerabilities
osvcheck || [ $? -eq 1 ]

# Fail on any vulnerabilities
osvcheck

Exceptions

Suppress an accepted finding in pyproject.toml under [tool.osvcheck.exceptions], or in osvcheck.toml under [exceptions]. Each exception needs either a review date or an explicit permanent flag:

[tool.osvcheck.exceptions]
# Review a temporary exception before this date.
requests = { expires = 2026-06-01, reason = "Waiting for an upstream release." }

# httpx requires certifi, but this project configures httpx to use the system
# keychain rather than certifi's CA bundle.
certifi = { permanent = true, reason = "httpx uses the system keychain." }

expires and permanent = true are mutually exclusive. A standalone osvcheck.toml takes precedence when both configuration files are present.

Features

  • Scans Python dependencies for known security vulnerabilities
  • Uses the OSV (Open Source Vulnerabilities) database
  • Multi-environment support with auto-detection:
    • Uses uv.lock if present and up-to-date (fastest)
    • Falls back to uv pip list if uv is available
    • Falls back to pip list if pip is available
    • Prefers an active or single marker-identified local virtualenv
  • Smart caching with 12-48 hour randomized TTL
  • Distinguishes between direct and indirect dependency vulnerabilities
  • Zero runtime dependencies (Python stdlib only)
  • Optional rich integration for enhanced output (auto-detected if already installed)

License

MIT License - See LICENSE file for details.

Metadata

Release files for osvcheck 1.6.0

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

Source distribution (sdist)

Source distribution for osvcheck 1.6.0
File Size Uploaded Provenance Actions
osvcheck-1.6.0.tar.gz 14.3 kB With provenance Details for osvcheck-1.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 32.1 kB

Release files / osvcheck-1.6.0.tar.gz

Download URL osvcheck-1.6.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f160f1b7df25fbe05c7cc808e227afbcc011c0b7251897653ef8e731f42c283f
BLAKE2b-256 checksum
How to use checksums
21cf1e5eb0f1e9628ac5cbf3fef71baf4b0a79d8afe5fb18494d120f01723d6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 26, 2026.

Transparency log

Release files / osvcheck-1.6.0-py3-none-any.whl

Download URL osvcheck-1.6.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7609a7f4843496def315a526f1bf98aeb4792642af25895daf9ae399c89e394
BLAKE2b-256 checksum
How to use checksums
c9c267b0134bede649adee2c97e97c26b94cd028de19c8e66a3585ab011ffa1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 26, 2026.

Transparency log

Security for osvcheck 1.6.0

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 osvcheck-1.6.0.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 Oct 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.

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