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

# 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
  • 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.5.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.5.0
File Size Uploaded Provenance Actions
osvcheck-1.5.0.tar.gz 13.0 kB With provenance Details for osvcheck-1.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 29.5 kB

Release files / osvcheck-1.5.0.tar.gz

Download URL osvcheck-1.5.0.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
eaf8cf9a491bdbf9061150f58293b9fdda36144b81cb582b6a658e581cbd7a70
BLAKE2b-256 checksum
How to use checksums
a4b515c6eb1138e8bac81e5aa23d2ab79fc67ea3c9a1e7d8bbaedf1791d8a85d
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.5.0-py3-none-any.whl

Download URL osvcheck-1.5.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0179e722d273c386d57a41894c4677a8f86fe9209cfd35569eafc5c0d088d1e9
BLAKE2b-256 checksum
How to use checksums
317a891ba4224b4486e4252ab02a20d4aa8017bb55bc2be54b985d736fde00e1
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.5.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.5.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