Skip to content

Commit 183a484

Browse files
committed
internal/{osv,report}: add support for non-Go version ranges
A non-Go version range can be used to specify versions used by module maintainers that do not conform to Go's module version conventions (https://go.dev/doc/modules/version-numbers). For now, these versions are not published in OSV. In the future, they will likely be published in an ecosystem_specific field and used for display purposes. Change-Id: I3fcd13a832fd91bce3dfaccd56e63a06e95410b3 Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/568057 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Damien Neil <[email protected]>
1 parent 5e7d406 commit 183a484

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

doc/format.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ The version at which the vulnerability was fixed.
9191
If this field is omitted, it is assumed that every version since the
9292
`introduced` version is vulnerable.
9393

94+
### `module.non_go_versions`
95+
96+
type `string`
97+
98+
(Optional - used only in special cases, usually for binary reports.)
99+
100+
The non-Go version range(s) at which the package is vulnerable.
101+
102+
A non-Go version range can be used to specify versions used by
103+
module maintainers that do not conform to [Go's module
104+
version conventions](https://go.dev/doc/modules/version-numbers).
105+
94106
### `module.vulnerable_at`
95107

96108
type `string`

internal/report/report.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ type UnsupportedVersion struct {
3939
type Module struct {
4040
Module string `yaml:",omitempty"`
4141
Versions []VersionRange `yaml:",omitempty"`
42+
// Versions that are not known to the module proxy, but
43+
// that may be useful to display to humans.
44+
NonGoVersions []VersionRange `yaml:"non_go_versions,omitempty"`
4245
// Version types that exist in OSV, but we don't support.
4346
// These may be added when automatically creating a report,
4447
// but must be deleted in order to pass lint checks.

0 commit comments

Comments
 (0)