Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
57c8d58
Change API design
TG1999 Mar 11, 2026
3172cab
Restructure V3 API
TG1999 Mar 11, 2026
3b7f794
Fix formatting issues
TG1999 Mar 16, 2026
5981a7f
Add tests
TG1999 Mar 16, 2026
4461016
Disable Admin panel
TG1999 Mar 16, 2026
e8abe85
Inline vulnerability data
TG1999 Mar 16, 2026
1adbb4a
Revert changes
TG1999 Mar 16, 2026
6f065ef
Fix tests
TG1999 Mar 16, 2026
a7520b3
Remove advisories count
TG1999 Mar 16, 2026
9e72dec
Make search more efficient
TG1999 Mar 16, 2026
c52e2ab
Make improvers query correct and faster
TG1999 Mar 17, 2026
34f2083
Fix formatting issues
TG1999 Mar 17, 2026
22493b2
Optimize package risk score calculation
TG1999 Mar 17, 2026
eded065
Use only latest per avid aadvisories to compute package risk score
TG1999 Mar 17, 2026
7847c34
Handle packages which are subject of more than 100 advisories
TG1999 Mar 17, 2026
d189bf6
Add URLs
TG1999 Mar 17, 2026
7f80d66
Optimize views
TG1999 Mar 17, 2026
ed19a1f
Fix rst file formatting
TG1999 Mar 17, 2026
efe8934
Optimize latest advisories for purls
TG1999 Mar 18, 2026
a206788
Optimize AdvisoryV2QuerySet
TG1999 Mar 18, 2026
3cc6156
Optimize queries
TG1999 Mar 18, 2026
feff85f
Optimise package details
TG1999 Mar 18, 2026
979d564
Optimize package details view
TG1999 Mar 18, 2026
bc1a434
Optimize views
TG1999 Mar 18, 2026
a5aa671
Optimize queries
TG1999 Mar 18, 2026
dc1a076
Fix typo in archlinux importer
TG1999 Mar 19, 2026
4d26443
All vulnerable packages API
TG1999 Mar 19, 2026
f04f625
Optimize advisoryqueyset
TG1999 Mar 19, 2026
7921055
Fix errors
TG1999 Mar 19, 2026
455a0fe
Forward to HTTPS
TG1999 Mar 19, 2026
584fd49
Group advisories with alias and affected packages
TG1999 Mar 26, 2026
59fd85f
Fix content hash logic
TG1999 Mar 26, 2026
f562fd8
Test out small use case
TG1999 Mar 26, 2026
931e111
Group for all packages
TG1999 Mar 26, 2026
3286f90
Change process to compute hash
TG1999 Mar 26, 2026
8266b25
Prefetch affected packages
TG1999 Mar 26, 2026
bf29369
Cache the advisory content hash
TG1999 Mar 26, 2026
680f45e
Group specific ecosystems
TG1999 Mar 27, 2026
b9c4f18
Group specific ecosystems
TG1999 Mar 27, 2026
312d444
Use V2 views
TG1999 Mar 27, 2026
0b753c9
Adjust API and UI for new grouping
TG1999 Mar 30, 2026
8dac89e
Handle None in UI
TG1999 Mar 30, 2026
b20dc39
Handle large number of advisories case
TG1999 Mar 30, 2026
4f97321
Fix views
TG1999 Mar 30, 2026
4f2d149
Fix views
TG1999 Mar 30, 2026
610c205
Add risk, severity and exploits
TG1999 Mar 30, 2026
af98f07
Dedupe fixed_by_packages
TG1999 Mar 30, 2026
97da322
Fix severity and exploit calculation
TG1999 Mar 30, 2026
07433dc
Fix grouping
TG1999 Mar 31, 2026
cfb2d7d
Fix API
TG1999 Mar 31, 2026
28c5c63
Ignore goruped case
TG1999 Mar 31, 2026
7c4859e
Revert grouping
TG1999 Mar 31, 2026
8f17b7e
Change advisory ID for pypa importer
TG1999 Mar 31, 2026
5951dfd
Change documentation
TG1999 Mar 31, 2026
63f3416
Increase page_size for pagination
TG1999 Mar 31, 2026
e168ba9
Remove risk score from UI
TG1999 Apr 1, 2026
012c3ac
Update API V3 usage
TG1999 Apr 1, 2026
ae1b71b
Change tests
TG1999 Apr 1, 2026
0eb2acd
Update changelog and prep for release
TG1999 Apr 1, 2026
67cf364
Fix tests
TG1999 Apr 1, 2026
fd52509
Fix views for ungrouped advisories
TG1999 Apr 1, 2026
959709c
Minor fixes
TG1999 Apr 2, 2026
78ca528
Compute rank while unfurling
TG1999 Apr 2, 2026
c341e6b
Adjust precedence of importers
TG1999 Apr 2, 2026
54b0fc9
Upgrade black
TG1999 Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release notes
=============

Version v38.0.0
---------------------

- This is a major version, we have changed our V3 API, refer to ``api_v3_usage.rst`` for details.
- We have started grouping advisories which have aliases or identifiers in common and also affect same set of packages together.

Version v37.0.0
---------------------

Expand Down
2 changes: 1 addition & 1 deletion PIPELINES-AVID.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* - project-kb-statements_v2
- Vulnerability ID of the record
* - pypa_importer_v2
- ID of the OSV record
- {package_name}/{ID of the OSV record}
* - pysec_importer_v2
- ID of the OSV record
* - redhat_importer_v2
Expand Down
254 changes: 254 additions & 0 deletions api_v3_usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
Package Endpoint
================

We are migrating from **API v1** to **API v3**.

Previously, the ``/api/packages`` endpoint exposed multiple routes:

- ``bulk_search``
- ``bulk_lookup``
- ``lookup``
- ``all``

In **API v3**, all these capabilities are consolidated into a **single endpoint**:

::

POST /api/v3/packages


Pagination
----------

Responses from the package endpoint are **always paginated**, with **10 results per page**.

Each response includes:

- ``count`` — total number of results
- ``next`` — URL for the next page
- ``previous`` — URL for the previous page

If a package is associated with **more than 100 advisories**, the response will include:

- ``affected_by_vulnerabilities_url`` instead of ``affected_by_vulnerabilities``
- ``fixing_vulnerabilities_url`` instead of ``fixing_vulnerabilities``


Getting All Vulnerable Packages
-------------------------------

Instead of calling ``/api/packages/all``, call the v3 endpoint with an empty ``purls`` list.

::

POST /api/v3/packages

{
"purls": []
}

Example response:

::

{
"count": 596,
"next": "http://example.com/api/v3/packages?page=2",
"previous": null,
"results": [
"pkg:npm/626@1.1.1",
"pkg:npm/aedes@0.35.0",
"pkg:npm/airbrake@0.3.8",
"pkg:npm/angular-http-server@1.4.3",
"pkg:npm/apex-publish-static-files@2.0.0",
"pkg:npm/atob@2.0.3",
"pkg:npm/augustine@0.2.3",
"pkg:npm/backbone@0.3.3",
"pkg:npm/base64-url@1.3.3",
"pkg:npm/base64url@2.0.0"
]
}


Bulk Search (Replacement)
-------------------------

Instead of calling ``/api/packages/bulk_search``, use:

::

POST /api/v3/packages

Parameters:

- ``purls`` — list of package URLs to query
- ``details`` — boolean (default: ``false``)
- ``ignore_qualifiers_subpath`` — boolean (default: ``false``)

The ``ignore_qualifiers_subpath`` flag replaces the previous ``plain_purl`` parameter.
When set to ``true``, qualifiers and subpaths in PURLs are ignored.


Get Only Vulnerable PURLs
~~~~~~~~~~~~~~~~~~~~~~~~~

::

POST /api/v3/packages

{
"purls": ["pkg:npm/atob@2.0.3", "pkg:pypi/sample@2.0.0"],
"details": false
}

Example response:

::

{
"count": 1,
"next": null,
"previous": null,
"results": [
"pkg:npm/atob@2.0.3"
]
}


Get Detailed Vulnerability Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

POST /api/v3/packages

{
"purls": ["pkg:npm/atob@2.0.3", "pkg:pypi/sample@2.0.0"],
"details": true
}

Example response:

::

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"purl": "pkg:npm/atob@2.0.3",
"affected_by_vulnerabilities": [
{
"advisory_id": "GHSA-g5vw-3h65-2q3v",
"aliases": [],
"weighted_severity": null,
"exploitability_score": null,
"risk_score": null,
"summary": "Access control vulnerable to user data",
"fixed_by_packages": [
"pkg:pypi/accesscontrol@7.2"
],
},
],
"fixing_vulnerabilities": [],
"next_non_vulnerable_version": "2.1.0",
"latest_non_vulnerable_version": "2.1.0",
"risk_score": null
}
]
}


Using Approximate Matching
~~~~~~~~~~~~~~~~~~~~~~~~~~

::

POST /api/v3/packages

{
"purls": ["pkg:npm/atob@2.0.3?foo=bar"],
"ignore_qualifiers_subpath": true,
"details": true
}

Example response:

::

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"purl": "pkg:npm/atob@2.0.3",
"affected_by_vulnerabilities": [
{
"advisory_id": "GHSA-g5vw-3h65-2q3v",
"aliases": [],
"weighted_severity": null,
"exploitability_score": null,
"risk_score": null,
"summary": "Access control vulnerable to user data",
"fixed_by_packages": [
"pkg:pypi/accesscontrol@7.2"
],
}
],
"fixing_vulnerabilities": [],
"next_non_vulnerable_version": "2.1.0",
"latest_non_vulnerable_version": "2.1.0",
"risk_score": null
}
]
}


Advisory Endpoint
=================

Retrieve advisories for one or more PURLs:

::

POST /api/v3/advisories

{
"purls": ["pkg:npm/atob@2.0.3", "pkg:pypi/sample@2.0.0"]
}

Responses are paginated (10 results per page) and include ``next`` and ``previous`` links.


Affected-By Advisories Endpoint
===============================

Retrieve advisories that **affect (impact)** a given PURL:

::

GET /api/v3/affected-by-advisories?purl=<purl>

Example:

::

GET /api/v3/affected-by-advisories?purl=pkg:npm/atob@2.0.3


Fixing Advisories Endpoint
==========================

Retrieve advisories that are **fixed by** a given PURL:

::

GET /api/v3/fixing-advisories?purl=<purl>

Example:

::

GET /api/v3/fixing-advisories?purl=pkg:npm/atob@2.1.0
2 changes: 2 additions & 0 deletions etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ server {
proxy_redirect off;
client_max_body_size 10G;
proxy_read_timeout 600s;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
}

location /static/ {
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = vulnerablecode
version = 37.0.0
version = 38.0.0
license = Apache-2.0 AND CC-BY-SA-4.0

# description must be on ONE line https://github.com/pypa/setuptools/issues/1390
Expand Down
Loading
Loading