Score whether a security finding already overlaps a published OSV/NVD advisory for a PyPI package, so scanners can skip known vulnerabilities.
Project description
osv-dedupe
Given a security finding for a PyPI package, decide whether it's already a
published vulnerability before you spend time (or LLM tokens) triaging it.
osv-dedupe queries OSV (and optionally
NVD), then scores each candidate advisory against your
finding using source reliability, package-name presence, CWE overlap, and
file/function hints.
Install
pip install osv-dedupe
Library usage
from osv_dedupe import find_known_advisory_matches
finding = {"cwe": "CWE-22", "path": "demo/tarfile_utils.py"}
matches = find_known_advisory_matches("demo", "1.0.0", finding)
for m in matches:
print(m["confidence"], m["source"], m["id"], m["url"])
print(m["reason"])
Each match is a dict with source, id, url, confidence (0.0–1.0),
reason, aliases, cwes, and summary. A confidence >= 0.70 is generally
strong enough to treat the finding as already reported.
Options:
min_confidence(default0.70) — threshold for returned matches.include_nvd(defaultFalse) — also keyword-search NVD (slower, noisier).limit(default3) — max matches returned.
CLI
osv-dedupe requests 2.0.0 --cwe CWE-22
osv-dedupe django 3.2 --include-nvd --json
Scoring
| Signal | Weight |
|---|---|
| OSV returned the advisory | +0.45 |
| NVD keyword hit | +0.30 |
| Package name in advisory text | +0.15 |
| CWE matches finding | +0.25 |
| CWE differs | −0.10 |
| File/function hint appears | +0.10 |
Confidence is clamped to [0.0, 1.0]. All network calls are best-effort: if OSV
or NVD are unreachable, you get an empty list, never an exception. Results are
cached in-process; call clear_cache() to reset.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osv_dedupe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: osv_dedupe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f131d48cbc809a98f4b6a45ff7dc0926163bda4c6dfce0014d7d7587bde41a6
|
|
| MD5 |
d6d105c53a54e7820e5b529538e00406
|
|
| BLAKE2b-256 |
771912695708f92332f22be93fd1a4b40361c1c3a3244cff876875de6ee7313d
|