Skip to content

Commit

Permalink
fix: #159 vulnz is failing cve caching from NVD due to an introduced …
Browse files Browse the repository at this point in the history
…'cveTags' property. Fix adds ignore unknown properties flag on CveItem.java to support new introduced properties without failing.
  • Loading branch information
jessebluemr committed Mar 21, 2024
1 parent 5988546 commit 461653a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
Expand All @@ -30,6 +31,7 @@
import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonPropertyOrder({"id", "sourceIdentifier", "published", "lastModified", "vulnStatus", "evaluatorComment",
"evaluatorSolution", "evaluatorImpact", "cisaExploitAdd", "cisaActionDue", "cisaRequiredAction",
"cisaVulnerabilityName", "descriptions", "vendorComments", "metrics", "weaknesses", "configurations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ public Collection<DefCveItem> next() {
current = objectMapper.readValue(json, CveApiJson20.class);
this.indexesToRetrieve.remove(call.getStartIndex());
} catch (JsonProcessingException e) {
LOG.debug("Error processing NVD data", e);
// really re-fetch the same data?
return next();
}
this.totalAvailable = current.getTotalResults();
Expand Down
8 changes: 8 additions & 0 deletions open-vulnerability-clients/src/test/resources/nvd.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
"published": "2008-07-27T22:41:00.000",
"lastModified": "2017-08-08T01:31:28.247",
"vulnStatus": "Modified",
"cveTags": [
{
"sourceIdentifier": "[email protected]",
"tags": [
"disputed"
]
}
],
"descriptions": [
{
"lang": "en",
Expand Down

0 comments on commit 461653a

Please sign in to comment.