Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(osv): stop adding ID of record to "related" too #1365

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 3 deletions pkg/advisory/osv.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ func BuildOSVDataset(ctx context.Context, opts OSVOptions) error {
continue
}

// Note: The OSV data should include our advisory ID itself among the listed
// related vulnerability IDs.
related := append([]string{adv.ID}, adv.Aliases...)
// TODO: Use the 'upstream' field instead of 'related'. See https://github.com/ossf/osv-schema/pull/312.
// Make sure to communicate to data consumers ahead of this change, though!
related := adv.Aliases

affecteds := make([]models.Affected, 0, len(affectedPackages))
for _, pkg := range affectedPackages {
Expand Down
1 change: 0 additions & 1 deletion pkg/advisory/testdata/osv/expected/CGA-37qj-pjrf-fmrw.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"modified": "2022-09-15T02:40:18Z",
"id": "CGA-37qj-pjrf-fmrw",
"related": [
"CGA-37qj-pjrf-fmrw",
"CVE-2020-8927"
],
"affected": [
Expand Down
1 change: 0 additions & 1 deletion pkg/advisory/testdata/osv/expected/CGA-5f5c-53mg-6p2v.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"modified": "2023-05-04T14:34:34Z",
"id": "CGA-5f5c-53mg-6p2v",
"related": [
"CGA-5f5c-53mg-6p2v",
"GHSA-33pg-m6jh-5237"
],
"affected": [
Expand Down
1 change: 0 additions & 1 deletion pkg/advisory/testdata/osv/expected/CGA-6mjr-v678-c6gm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"modified": "2023-02-07T16:50:17Z",
"id": "CGA-6mjr-v678-c6gm",
"related": [
"CGA-6mjr-v678-c6gm",
"CVE-2022-4450"
],
"affected": [
Expand Down
1 change: 0 additions & 1 deletion pkg/advisory/testdata/osv/expected/CGA-gg4h-ppqq-vf35.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"modified": "2023-05-04T14:34:34Z",
"id": "CGA-gg4h-ppqq-vf35",
"related": [
"CGA-gg4h-ppqq-vf35",
"GHSA-6wrf-mxfj-pf5p"
],
"affected": [
Expand Down
1 change: 0 additions & 1 deletion pkg/advisory/testdata/osv/expected/CGA-mm7m-x6cw-5fg4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"modified": "2023-04-08T16:32:54Z",
"id": "CGA-mm7m-x6cw-5fg4",
"related": [
"CGA-mm7m-x6cw-5fg4",
"CVE-2023-0466"
],
"affected": [
Expand Down
1 change: 0 additions & 1 deletion pkg/advisory/testdata/osv/expected/CGA-vj68-6p3f-8xmr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"modified": "2023-03-28T14:54:27Z",
"id": "CGA-vj68-6p3f-8xmr",
"related": [
"CGA-vj68-6p3f-8xmr",
"CVE-2023-0465"
],
"affected": [
Expand Down
Loading