Safeguard
Supply Chain•

Where do Python package advisories come from, and how do you follow them?

Python advisories come from the community owned PyPA Advisory Database, shared through OSV and the PyPI JSON API. How to query it and what to watch for.

Safeguard Security Team
4 min read

Many Python advisories come from the Python Packaging Advisory Database, a community owned repository of advisories for packages on PyPI. Its data is exposed through pip-audit, the OSV API and the PyPI JSON API, so you can follow it without cloning the repository.

What the database is

The PyPA project describes its repository as a community owned set of advisories for packages published on PyPI. Each advisory lives in a YAML file in the vulns directory and follows the OSV schema. New entries arrive as pull requests, and automation allocates the final ID once a change is merged, which is why new files are named with a PYSEC-0000- placeholder.

Where the records come from

According to the repository README, much of the existing set is collected from the NVD CVE feed. A tool performs heuristics to match CVEs with exact Python packages and versions, and a small amount of human triage produces the YAML entries. The README itself calls that matching a difficult problem.

That has a practical meaning for you. A record built by matching can be less precise than one written by a maintainer, so a surprising result deserves a look at the advisory text before you act on it.

Three ways to consume it

MethodWhat you doGood for
pip-auditRun it against a requirements file or an environmentCI checks and local runs
OSV APIPOST a package name, ecosystem and version to the query endpointCustom tooling
PyPI JSON APIRead the known vulnerabilities section for a projectChecking one package

The README shows the OSV query shape: a JSON body with a version and a package object holding the name and the ecosystem value PyPI. It also shows pip-audit installed with pip and run with -r requirements.txt, plus a GitHub Action published under the pypa organization.

An optional precision field

The README describes an ecosystem_specific block that can list the exact modules and attributes affected, for example a single class inside a larger package. When a record includes it, a tool that understands it can reduce false positives, because an import of an unaffected part of the package would not match. Not every record has it, so do not assume it exists.

A short routine

  1. Pin and lock your Python dependencies so there is a clear version to check.
  2. Run pip-audit in CI on every pull request and on a nightly schedule, since new advisories appear without any change in your code.
  3. When a finding appears, open the advisory and read the affected range and fixed version.
  4. Check whether your code imports the affected module. If the record names one, that is a quick test.
  5. Upgrade, or record why you are not affected.

Some Python projects, such as Django, also publish their own security releases and policies. Following those gives you early context that a database entry may add later.

Try it yourself

Click through it at your own pace, or open it full screen. Notice how a dependency list becomes the thing an advisory is matched against.

Where Safeguard fits

Safeguard's SBOM and dependency scanning checks the dependencies you ship against advisory data, and reachability analysis helps show whether the vulnerable code is called. A free scan is at https://gold.safeguard.sh/scan.

Quick check

Does pip-audit use the PyPA data?

Yes. The PyPA README states the data is exposed by pip-audit.

Is every PYSEC record written by a human?

No. The README says much of the set is collected from the NVD feed with automated matching and a small amount of human triage.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.