Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0efaf6d
support wordpress ecosystem extraction using cve5
jess-lowe Jul 15, 2026
faa1f59
no packageinfo on git
jess-lowe Jul 15, 2026
5dd81f3
patchstack
jess-lowe Jul 29, 2026
e8c3e91
refactor to share wordpress slug logic and add wpscan
jess-lowe Jul 29, 2026
aaaf3b5
Merge branch 'master' into feat/support-wordpress
jess-lowe Jul 29, 2026
2b702fb
add useful links
jess-lowe Jul 30, 2026
f27ff3a
turn the wordpress cnas into handlers to unify extractors
jess-lowe Jul 30, 2026
bfb136b
Merge branch 'master' into feat/support-wordpress
jess-lowe Aug 3, 2026
c2bfce6
Merge remote-tracking branch 'upstream/master' into feat/support-word…
jess-lowe Aug 11, 2026
0b81ec2
update some wordpress stuff
jess-lowe Aug 13, 2026
5e5684e
Merge branch 'master' into feat/support-wordpress
jess-lowe Aug 24, 2026
e7e424f
fix lint ?
jess-lowe Aug 24, 2026
93676d1
add test file
jess-lowe Aug 24, 2026
c5a908c
only use refs to extract slugs - may need to be revised on cna case-b…
jess-lowe Aug 24, 2026
0c61105
fix lint
jess-lowe Aug 24, 2026
5c1fcc0
testcase
jess-lowe Aug 24, 2026
91e835e
more missing testdata
jess-lowe Aug 24, 2026
08f3db6
Strategy based refactor
jess-lowe Sep 2, 2026
1e829b0
linux
jess-lowe Aug 17, 2026
7a775d6
fix some artifacts
jess-lowe Sep 2, 2026
beeb0df
cleanup
jess-lowe Sep 2, 2026
16bdbc5
remove wordpress for now
jess-lowe Sep 2, 2026
0e462d6
lint and snaps
jess-lowe Sep 3, 2026
d44272e
put strategies in their own folders
jess-lowe Sep 21, 2026
a476031
Merge remote-tracking branch 'upstream/master' into refactor/strategies
jess-lowe Sep 21, 2026
b66b69b
fix instances of addnote
jess-lowe Sep 21, 2026
f8d1747
fix test
jess-lowe Sep 21, 2026
d3803eb
refactor(vulnfeeds): move CVE5 version extraction strategies to Affec…
jess-lowe Sep 22, 2026
2d63651
add missing testcase
jess-lowe Sep 22, 2026
4f092eb
Merge branch 'refactor/strategies' into refactor/strat/versions-combined
jess-lowe Sep 22, 2026
db8ba4e
Merge branch 'master' into refactor/strategies
jess-lowe Sep 23, 2026
c97c6f0
add examples to presets.go and remove wp cnas for now
jess-lowe Sep 25, 2026
0d3b92a
lint
jess-lowe Sep 25, 2026
3ef0370
Merge branch 'refactor/strategies' into feat/support-wordpress
jess-lowe Sep 28, 2026
ee2f864
wordpress merging updates
jess-lowe Sep 28, 2026
7b85a0b
Merge branch 'master' into feat/support-wordpress
jess-lowe Sep 29, 2026
7d3f519
Merge branch 'master' into feat/support-wordpress
jess-lowe Oct 1, 2026
4e64c5b
add the more regex
jess-lowe Oct 15, 2026
e026050
Merge branch 'feat/support-wordpress' of https://github.com/jess-lowe…
jess-lowe Oct 15, 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 vulnfeeds/conversion/cve5/extraction.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ func GetVersionExtractor(cna string) VersionExtractor {
switch cna {
case "Linux":
return &LinuxVersionExtractor{}
case "Wordfence":
return &WordpressExtractor{Handler: &WordfenceHandler{}}
case "Patchstack":
return &WordpressExtractor{Handler: &PatchstackHandler{}}
case "WPScan":
return &WordpressExtractor{Handler: &WPScanHandler{}}
default:
return &DefaultVersionExtractor{}
}
Expand Down
14 changes: 13 additions & 1 deletion vulnfeeds/conversion/cve5/strategies.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,19 @@ func initialNormalExtraction(vers models.Versions, metrics *models.ConversionMet
introduced = vers.Version
metrics.AddNote("%s - Introduced from version value - %s", vQuality.String(), vers.Version)
}
if vLessThanQual.AtLeast(acceptableQuality) {
// Prefer changes for fixed version if available.
var fixedFromChanges string
for _, ch := range vers.Changes {
if ch.Status == "unaffected" && ch.At != "" {
fixedFromChanges = ch.At
break
}
}

if fixedFromChanges != "" {
fixed = fixedFromChanges
metrics.AddNote("Fixed from changes - %s", fixed)
} else if vLessThanQual.AtLeast(acceptableQuality) {
fixed = vers.LessThan
metrics.AddNote("%s - Fixed from LessThan value - %s", vLessThanQual.String(), vers.LessThan)
} else if vLTOEQual.AtLeast(acceptableQuality) {
Expand Down
90 changes: 89 additions & 1 deletion vulnfeeds/conversion/cve5/version_extraction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,26 @@ func TestFindNormalAffectedRanges(t *testing.T) {
},
wantRangeType: VersionRangeTypeGit,
},
{
name: "changes preferred over lessThanOrEqual with filler version",
affected: models.Affected{
Versions: []models.Versions{
{
Status: "affected",
Version: "n/a",
LessThanOrEqual: "1.0.32",
Changes: []models.Change{
{At: "1.0.33", Status: "unaffected"},
},
VersionType: "custom",
},
},
},
wantRanges: []*osvschema.Range{
conversion.BuildVersionRange("0", "", "1.0.33"),
},
wantRangeType: VersionRangeTypeEcosystem,
},
}

for _, tt := range tests {
Expand Down Expand Up @@ -381,6 +401,15 @@ func TestGetVersionExtractor(t *testing.T) {
},
expectedType: reflect.TypeOf(&LinuxVersionExtractor{}),
},
{
name: "Wordfence CVE",
cve: models.CVE5{
Metadata: models.CVE5Metadata{
AssignerShortName: "Wordfence",
},
},
expectedType: reflect.TypeOf(&WordpressExtractor{}),
},
{
name: "Default CVE",
cve: models.CVE5{
Expand Down Expand Up @@ -593,13 +622,72 @@ func TestExtractVersions(t *testing.T) {
},
}},
},
{
name: "CVE-2026-1293",
cve: loadTestData(t, "CVE-2026-1293"),
cnaAssigner: "Wordfence",
repos: []string{},
expectedAffected: []*osvschema.Affected{{
Package: &osvschema.Package{
Ecosystem: "WordPress:Plugin",
Name: "wordpress-seo",
},
Ranges: []*osvschema.Range{{
Type: osvschema.Range_ECOSYSTEM,
Events: []*osvschema.Event{
{Introduced: "0"},
{LastAffected: "26.8"},
},
}},
}},
},
{
name: "CVE-2021-23209",
cve: loadTestData(t, "CVE-2021-23209"),
cnaAssigner: "Patchstack",
repos: []string{},
expectedAffected: []*osvschema.Affected{{
Package: &osvschema.Package{
Ecosystem: "WordPress:Plugin",
Name: "accelerated-mobile-pages",
},
Ranges: []*osvschema.Range{{
Type: osvschema.Range_ECOSYSTEM,
Events: []*osvschema.Event{
{Introduced: "0"},
{Fixed: "1.0.77.33"},
},
}},
}},
},
{
name: "CVE-2015-10001",
cve: loadTestData(t, "CVE-2015-10001"),
cnaAssigner: "WPScan",
repos: []string{},
expectedAffected: []*osvschema.Affected{{
Package: &osvschema.Package{
Ecosystem: "WordPress:Plugin",
Name: "wp-stats",
},
Ranges: []*osvschema.Range{{
Type: osvschema.Range_ECOSYSTEM,
Events: []*osvschema.Event{
{Introduced: "2.52"},
{LastAffected: "2.52"},
},
}},
}},
},
}

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
metrics := &models.ConversionMetrics{}
v := vulns.Vulnerability{
Vulnerability: &osvschema.Vulnerability{},
Vulnerability: &osvschema.Vulnerability{
References: vulns.ClassifyReferences(identifyPossibleURLs(tc.cve)),
},
}
extractor := GetVersionExtractor(tc.cnaAssigner)
extractor.ExtractVersions(tc.cve, &v, metrics, tc.repos)
Expand Down
Loading
Loading