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

Is NVD API very slow for dependency check today? #6531

Closed
arnabcse28 opened this issue Mar 20, 2024 · 43 comments
Closed

Is NVD API very slow for dependency check today? #6531

arnabcse28 opened this issue Mar 20, 2024 · 43 comments
Labels

Comments

@arnabcse28
Copy link

arnabcse28 commented Mar 20, 2024

I am consistently getting errors while trying to get updates for my builds from NVD at: dependency-check-maven:9.0.10:check
It started late morning today (March 20th, 2024) and the issue occurs with or without using a NVD API Key. Before today the same was working seamlessly with same infrastructures (Jenkins as well as individual workstation).

Below is a sample error that I have got after 59 minutes of run of the dependency update:

[DependencyCheck] [INFO] NVD API has 242,204 records in this update
[DependencyCheck] [INFO] Downloaded 10,000/242,204 (4%)
[DependencyCheck] [INFO] Downloaded 20,000/242,204 (8%)
[DependencyCheck] [INFO] Downloaded 30,000/242,204 (12%)
[DependencyCheck] [INFO] Downloaded 40,000/242,204 (17%)
[DependencyCheck] [INFO] Downloaded 50,000/242,204 (21%)
[DependencyCheck] [INFO] Downloaded 60,000/242,204 (25%)
[DependencyCheck] [INFO] Downloaded 70,000/242,204 (29%)
[DependencyCheck] [INFO] Downloaded 80,000/242,204 (33%)
[DependencyCheck] [INFO] Downloaded 90,000/242,204 (37%)
[DependencyCheck] [INFO] Downloaded 100,000/242,204 (41%)
[DependencyCheck] [INFO] Downloaded 110,000/242,204 (45%)
[DependencyCheck] [INFO] Downloaded 120,000/242,204 (50%)
[DependencyCheck] [INFO] Downloaded 130,000/242,204 (54%)
[DependencyCheck] [INFO] Downloaded 140,000/242,204 (58%)
[DependencyCheck] [INFO] Downloaded 150,000/242,204 (62%)
[DependencyCheck] [INFO] Downloaded 160,000/242,204 (66%)
[DependencyCheck] [INFO] Downloaded 170,000/242,204 (70%)
[DependencyCheck] [INFO] Downloaded 180,000/242,204 (74%)
[DependencyCheck] [INFO] Downloaded 190,000/242,204 (78%)
[DependencyCheck] [INFO] Downloaded 200,000/242,204 (83%)
[DependencyCheck] [INFO] Downloaded 210,000/242,204 (87%)
[DependencyCheck] [INFO] Downloaded 220,000/242,204 (91%)
[DependencyCheck] [INFO] Downloaded 230,000/242,204 (95%)
[DependencyCheck] [ERROR] Error updating the NVD Data
[DependencyCheck] org.owasp.dependencycheck.data.update.exception.UpdateException: Error updating the NVD Data
[DependencyCheck] at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:389)
[DependencyCheck] at org.owasp.dependencycheck.data.update.NvdApiDataSource.update(NvdApiDataSource.java:116)
[DependencyCheck] at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:906)
[DependencyCheck] at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:711)
[DependencyCheck] at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:637)
[DependencyCheck] at org.owasp.dependencycheck.App.runScan(App.java:262)
[DependencyCheck] at org.owasp.dependencycheck.App.run(App.java:194)
[DependencyCheck] at org.owasp.dependencycheck.App.main(App.java:89)
[DependencyCheck] Caused by: io.github.jeremylong.openvulnerability.client.nvd.NvdApiRetryExceededException: NVD Update Failed: attempted to retrieve starting index 222000 from the NVD unsuccessfully five times.
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.queueUnsuccessful(NvdCveClient.java:422)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.hasNext(NvdCveClient.java:300)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:323)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:324)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:324)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:324)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:324)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:324)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:324)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:341)
[DependencyCheck] at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:349)
[DependencyCheck] ... 7 common frames omitted
[DependencyCheck] [INFO] Skipping Known Exploited Vulnerabilities update check since last check was within 24 hours.
[DependencyCheck] [WARN] Unable to update 1 or more Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
[DependencyCheck] [ERROR] Unable to continue dependency-check analysis.
[DependencyCheck] [ERROR] One or more fatal errors occurred
[DependencyCheck] [ERROR] Error updating the NVD Data
[DependencyCheck] [ERROR] No documents exist

@giacgbj
Copy link

giacgbj commented Mar 20, 2024

From https://nvd.nist.gov:

NIST is currently working to establish a consortium to address challenges in the NVD program and develop improved tools and methods. You will temporarily see delays in analysis efforts during this transition. We apologize for the inconvenience and ask for your patience as we work to improve the NVD program.

However, it seems the process always gets stuck at

[INFO] Downloaded 230,000/242,227 (95%)

I'm playing with nvdApiDelay and nvdMaxRetryCount without any success.

@haoboliu66
Copy link

seeing the same error on 20th Mar too

@gredler
Copy link

gredler commented Mar 21, 2024

Would it be crazy to package the latest CVE data with each release and automate a weekly release or something? The random failures, slowdowns and memory issues are driving me nuts.

@jeremylong
Copy link
Owner

If you want to make your installation more stable - consider keeping the database around between executions. You should only have to download the full NVD data set once. See https://jeremylong.github.io/DependencyCheck/data/cacheh2.html

@michalszelagsonos
Copy link

Seeing the same issue FWIW. I had to flush the database because couple of my systems hit this error when trying to run the scan:

15:17:04  [ERROR] One or more fatal errors occurred
15:17:04  [ERROR] Unable to connect to the database - if this error persists it may be due to a corrupt database. Consider running `purge` to delete the existing database

I did the purge and now I am unable to rebuild the DB, hitting the described error at 95% consistently.

@chadlwilson
Copy link
Contributor

chadlwilson commented Mar 21, 2024

I'm caching/restoring the entire data dir and H2 database and I'm still seeing the NVD API failing repeatedly for even the few requests I need to make to fill in 24 hours of data, so I think it's having major problems. https://services.nvd.nist.gov appears basically completely down right now / 503ing.

@fmarot
Copy link
Contributor

fmarot commented Mar 21, 2024

FWIW I use the <autoUpdate>false</autoUpdate> in my (Maven) settings to prevent DepCheck updating the DB. It connects to a local PostgreSQL DB in which the data is saved. This DB is updated each night by another job which currently fails. But my analysis jobs do not fail thanks to autoUpdate being false.

cloudcreate-dk added a commit to cloudcreate-dk/essentials-spring-examples that referenced this issue Mar 21, 2024
Disabled dependencyCheck during Github build since NVD key update times out: jeremylong/DependencyCheck#6531

# Updated 3rd party dependencies:
- postgresql 42.7.3
- spring-boot 3.2.3
- awaitility 4.2.1
- spring-data-mongodb 4.2.4
- spring-data-jpa 3.2.4
- log4j-to-slf4j 2.23.1
- json-path 2.9.0
- micrometer 1.12.4
- micrometer-tracing 1.2.4
- netty 4.1.107.Final
- testcontainers 1.19.7
- jdbi3 3.45.1
- jackson 2.17.0
- reactor 2023.0.4
- spring 6.1.5
- mockito 5.11.0
- logback 1.5.3
- commons-compress 1.26.1

# Updated maven plugins:
- dependency-check-maven 9.0.10
- maven-compiler-plugin 3.13.0
- maven-gpg-plugin 3.2.1
@comanl
Copy link

comanl commented Mar 21, 2024

Reverting to version 8.4.3 has helped. NVD updates are downloaded

@jeremylong
Copy link
Owner

Even at the high failure rate which I don't have a lot of control over - following either of these should help:

@chadlwilson
Copy link
Contributor

chadlwilson commented Mar 21, 2024

Perhaps it was working a bit better earlier when these folks managed to get 95% through building a DB, but right now the failure rate for me seems to be 100% of requests to services.nvd.nist.gov. (I can't even get to NVD API has x records in this update when working with a cached DB)

So unless one has an already existing populated cache or mirror to work off with autoUpdate disabled (or increased validFor value) and is OK working on stale/cached data from earlier I'm not sure there is much that will help until NVD fix things on their end.

@comanl
Copy link

comanl commented Mar 21, 2024

@jeremylong what about having NVD as mirror similar to Retire JS Repository (i.e. https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json) as mentioned on page https://jeremylong.github.io/DependencyCheck/data/mirrornvd.html

@jeremylong
Copy link
Owner

@chadlwilson I've had the vulnz CLI updating nightly for a while now and haven't seen much of an issue:

https://github.com/dependency-check/DependencyCheck_Builder/actions/workflows/cache.yml

@jeremylong
Copy link
Owner

@chadlwilson but yes - for a brand new user this is problematic.

@chadlwilson
Copy link
Contributor

chadlwilson commented Mar 21, 2024

@jeremylong yeah, but the 100% failure rate is for the last 6 hours or so (not 24 hours ago when your job last ran successfully).

Your job that just kicked off 45m ago is stuck/failing like everyone else's: https://github.com/dependency-check/DependencyCheck_Builder/actions/runs/8374001401/job/22928273185

@irineuruiz
Copy link

Same problem here, it even seems to be worse today than yesterday

@asyedcloud
Copy link

agree with @irineuruiz today is worse. all ADO pipelines are failing today. we use ADO extension OWASP Dependency Check and run pipelines on self hosted agents with azure vm scale set.

@marcelstoer
Copy link
Contributor

Just some context for people who are maybe not following infosec news (no affiliation whatsoever).

@jeremylong
Copy link
Owner

Well - there is a data feed here: https://dependency-check.github.io/DependencyCheck_Builder/nvd_cache/

As @chadlwilson pointed out - the update is currently failing. But the data was refreshed last night so it is fairly current.

cloudcreate-dk added a commit to cloudcreate-dk/essentials-spring-examples that referenced this issue Mar 21, 2024
Disabled dependencyCheck during Github build since NVD key update times out: jeremylong/DependencyCheck#6531

# Updated 3rd party dependencies:
- postgresql 42.7.3
- spring-boot 3.2.3
- awaitility 4.2.1
- spring-data-mongodb 4.2.4
- spring-data-jpa 3.2.4
- log4j-to-slf4j 2.23.1
- json-path 2.9.0
- micrometer 1.12.4
- micrometer-tracing 1.2.4
- netty 4.1.107.Final
- testcontainers 1.19.7
- jdbi3 3.45.1
- jackson 2.17.0
- reactor 2023.0.4
- spring 6.1.5
- mockito 5.11.0
- logback 1.5.3
- commons-compress 1.26.1

# Updated maven plugins:
- dependency-check-maven 9.0.10
- maven-compiler-plugin 3.13.0
- maven-gpg-plugin 3.2.1

(cherry picked from commit f4a701b)
@adam-siklosi
Copy link

adam-siklosi commented Mar 21, 2024

@jeremylong I'm caching the db between runs using version 9.0.2 and 9.0.9 (cli). Today all our github actions are stuck in a loop in the retry request:

[INFO] Checking for updates
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 7 time
[WARN] NVD API request failures are occurring; retrying request for the 8 time
[WARN] NVD API request failures are occurring; retrying request for the 9 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 7 time

After a while it hits out of memory.

The counter looks off and it should stop after a while no? It so hardcore that i cannot even cancel the github workflows. :-D (I will have set a timeout for sure.)

@RDI-Blake
Copy link

@jeremylong I'm caching the db between runs using version 9.0.2 and 9.0.9 (cli). Today all our github actions are stuck in a loop in the retry request:

[INFO] Checking for updates
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 7 time
[WARN] NVD API request failures are occurring; retrying request for the 8 time
[WARN] NVD API request failures are occurring; retrying request for the 9 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 5 time
[WARN] NVD API request failures are occurring; retrying request for the 6 time
[WARN] NVD API request failures are occurring; retrying request for the 7 time

After a while it hits out of memory.

The counter looks off and it should stop after a while no? It so hardcore that i cannot even cancel the github workflows. :-D (I will have set a timeout for sure.)

Ran into this today too, it looks like a bug. The documentation says the default should be 10, but it infinitely loops.

@Cs4r
Copy link

Cs4r commented Mar 21, 2024

Reverting to version 8.4.3 works.

@Reamer
Copy link

Reamer commented Mar 21, 2024

Hi @jeremylong,

I have not yet familiarized myself with the download client and the NVD API. But I see via mvn dependency-check:update-only -X that the same API request is made several times. Sometimes it seems that a valid response (200) arrives. Of course there are also 503 responses.
Why is the same request executed several times?

[DEBUG] Requested At: 15:56:57; URI: /rest/json/cves/2.0?lastModStartDate=2024-03-19T18%3A15%3A06Z&lastModEndDate=2024-07-17T18%3A15%3A06Z&resultsPerPage=2000&startIndex=0
[DEBUG] Requested At: 15:59:21; URI: /rest/json/cves/2.0?lastModStartDate=2024-03-19T18%3A15%3A06Z&lastModEndDate=2024-07-17T18%3A15%3A06Z&resultsPerPage=2000&startIndex=0

@RDI-Blake
Copy link

Using 2 workarounds with latest build.:

  1. Setting nvdMaxRetryCount manually (used 5, didn't try default which is 10) seems to count properly.
  2. Using updateonly in a command before the scan, then adding noupdate to the scan command for Analysis does not continue after update failure #6535 to generate a report

cloudcreate-dk added a commit to cloudcreate-dk/essentials-spring-examples that referenced this issue Mar 21, 2024
Disabled dependencyCheck during Github build since NVD key update times out: jeremylong/DependencyCheck#6531

# Updated 3rd party dependencies:
- postgresql 42.7.3
- spring-boot 3.2.3
- awaitility 4.2.1
- spring-data-mongodb 4.2.4
- spring-data-jpa 3.2.4
- log4j-to-slf4j 2.23.1
- json-path 2.9.0
- micrometer 1.12.4
- micrometer-tracing 1.2.4
- netty 4.1.107.Final
- testcontainers 1.19.7
- jdbi3 3.45.1
- jackson 2.17.0
- reactor 2023.0.4
- spring 6.1.5
- mockito 5.11.0
- logback 1.5.3
- commons-compress 1.26.1

# Updated maven plugins:
- dependency-check-maven 9.0.10
- maven-compiler-plugin 3.13.0
- maven-gpg-plugin 3.2.1

(cherry picked from commit f4a701b)
cloudcreate-dk added a commit to cloudcreate-dk/essentials-spring-examples that referenced this issue Mar 21, 2024
Disabled dependencyCheck during Github build since NVD key update times out: jeremylong/DependencyCheck#6531

# Updated 3rd party dependencies:
- postgresql 42.7.3
- spring-boot 3.0.13
- awaitility 4.2.1
- spring-data-mongodb 4.0.12
- spring-data-jpa 3.0.12
- log4j-to-slf4j 2.23.1
- json-path 2.9.0
- micrometer 1.12.4
- micrometer-tracing 1.2.4
- netty 4.1.107.Final
- testcontainers 1.19.7
- jdbi3 3.45.1
- jackson 2.17.0
- reactor 2023.0.4
- spring 6.0.18
- mockito 5.11.0
- logback 1.5.3
- commons-compress 1.26.1
- spring-kafka 3.0.15

# Updated maven plugins:
- dependency-check-maven 9.0.10
- maven-compiler-plugin 3.13.0
- maven-gpg-plugin 3.2.1

(cherry picked from commit f4a701b)
@BlueSKySec
Copy link

BlueSKySec commented Mar 21, 2024

Same here (version 9.0.9), using local database.

Stuck in "update" forever.

Only workaround (pom.xml):

                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>${dependency-check-maven.version}</version>
                    <configuration>
                        <autoUpdate>false</autoUpdate>

If autoUpdate is set to false, database won't be updated, but at least the build-job is running...

@bmeier-pros
Copy link

I am seeing the same behavior as @Reamer with multiple retries of the same requests. With 9.0.10, I'm also not seeing the expected date range on the request URLs:

With 9.0.10:

 bash ➜ gw dCAg --debug | grep "HTTP/1.1"
2024-03-21T09:53:51.684-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000000 >> GET /rest/json/cves/2.0?resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:54:16.413-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000001: consume response HTTP/1.1 200 OK, entity len 3491443

2024-03-21T09:54:19.818-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000000 >> GET /rest/json/cves/2.0?resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:54:19.894-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000002: consume response HTTP/1.1 503 Service Unavailable, entity len 107

2024-03-21T09:54:24.901-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000000 >> GET /rest/json/cves/2.0?resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:54:24.974-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000002: consume response HTTP/1.1 503 Service Unavailable, entity len 107

2024-03-21T09:54:35.219-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000001 >> GET /rest/json/cves/2.0?resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:55:07.904-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000002: consume response HTTP/1.1 200 OK, entity len 3491443

2024-03-21T09:55:11.348-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000001 >> GET /rest/json/cves/2.0?resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:55:11.418-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000003: consume response HTTP/1.1 503 Service Unavailable, entity len 107

2024-03-21T09:55:16.420-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000001 >> GET /rest/json/cves/2.0?resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:55:16.493-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000003: consume response HTTP/1.1 503 Service Unavailable, entity len 107

With 9.0.9:

 bash ➜ gw dCAg --debug | grep "HTTP/1.1"
2024-03-21T09:58:00.281-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000000 >> GET /rest/json/cves/2.0?lastModStartDate=2024-03-19T19%3A15%3A07Z&lastModEndDate=2024-07-17T19%3A15%3A07Z&resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:58:30.043-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000001: consume response HTTP/1.1 200 OK, entity len 6347203

2024-03-21T09:58:35.981-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000000 >> GET /rest/json/cves/2.0?lastModStartDate=2024-03-19T19%3A15%3A07Z&lastModEndDate=2024-07-17T19%3A15%3A07Z&resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:58:36.054-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000002: consume response HTTP/1.1 503 Service Unavailable, entity len 107

2024-03-21T09:58:41.060-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000000 >> GET /rest/json/cves/2.0?lastModStartDate=2024-03-19T19%3A15%3A07Z&lastModEndDate=2024-07-17T19%3A15%3A07Z&resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:58:41.133-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000002: consume response HTTP/1.1 503 Service Unavailable, entity len 107

2024-03-21T09:58:51.401-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000001 >> GET /rest/json/cves/2.0?lastModStartDate=2024-03-19T19%3A15%3A07Z&lastModEndDate=2024-07-17T19%3A15%3A07Z&resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:58:58.307-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000002: consume response HTTP/1.1 200 OK, entity len 6347203

2024-03-21T09:59:03.996-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000001 >> GET /rest/json/cves/2.0?lastModStartDate=2024-03-19T19%3A15%3A07Z&lastModEndDate=2024-07-17T19%3A15%3A07Z&resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:59:31.481-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000003: consume response HTTP/1.1 200 OK, entity len 6347203

2024-03-21T09:59:36.523-0500 [DEBUG] [org.apache.hc.client5.http.headers] c-0000000001 >> GET /rest/json/cves/2.0?lastModStartDate=2024-03-19T19%3A15%3A07Z&lastModEndDate=2024-07-17T19%3A15%3A07Z&resultsPerPage=2000&startIndex=0 HTTP/1.1
2024-03-21T09:59:36.595-0500 [DEBUG] [org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec] ex-0000000004: consume response HTTP/1.1 503 Service Unavailable, entity len 107

@danshome
Copy link

Email from NIST...

Good afternoon,

We are aware of availability issues with the 2.0 API endpoints and are currently investigating. We apologize for the inconvenience at this time.

V/r,
Christopher Turner
National Vulnerability Database Team
National Institute of Standards and Technology (NIST)
nvd@nist.gov

cloudcreate-dk added a commit to cloudcreate-dk/essentials-spring-examples that referenced this issue Mar 21, 2024
Disabled dependencyCheck during Github build since NVD key update times out: jeremylong/DependencyCheck#6531

Updated 3rd party dependencies:

reactor 2020.0.42
spring 5.3.33
java-uuid-generator 5.0.0
kotlin 1.9.23
postgresql 42.7.3
awaitility 4.2.1
log4j-to-slf4j 2.23.1
json-path 2.9.0
micrometer 1.12.4
micrometer-tracing 1.2.4
netty 4.1.107.Final
testcontainers 1.19.7
jdbi3 3.45.1
jackson 2.17.0
mockito 5.11.0
commons-compress 1.26.1

Updated maven plugins:

dependency-check-maven 9.0.10
maven-compiler-plugin 3.13.0
maven-gpg-plugin 3.2.1

(cherry picked from commit f4a701b)
@OrangeDog
Copy link

OrangeDog commented Mar 21, 2024

The retry limit is definitely broken. This was with it set to 2:

[WARNING] NVD API request failures are occurring; retrying request for the 1 time
[WARNING] NVD API request failures are occurring; retrying request for the 2 time
[WARNING] NVD API request failures are occurring; retrying request for the 3 time
[WARNING] NVD API request failures are occurring; retrying request for the 1 time
[WARNING] NVD API request failures are occurring; retrying request for the 1 time
[WARNING] NVD API request failures are occurring; retrying request for the 1 time
<killed by CI timeout>

And when it was set to 0:

[WARNING] NVD API request failures are occurring; retrying request for the 1 time
[WARNING] NVD API request failures are occurring; retrying request for the 1 time
[WARNING] NVD API request failures are occurring; retrying request for the 1 time

@efenderbosch-atg
Copy link

What about an alternate data feed, like https://osv.dev/?

Obviously, this would be a major change for this project.

@arnabcse28
Copy link
Author

As opposed to what some people have indicated, reverting to version 8.4.3 does NOT actually work.
I tried that even before posting this issue and it worked once on my local laptop but continues to fail on CI and subsequent builds (after 4 hours interval) on my local as well.

However, if anyone experienced otherwise recently, we could use that as an alternative to partially unblock ourselves.

@irineuruiz
Copy link

@arnabcse28 We switched back to version 8.4.3 two hours ago and it worked, but we've only run it twice so far.

@danshome
Copy link

@jeremylong

Maybe change the code so that if it fails to connect NVD, it falls back to what's cached instead of failing. For example, it tries 10 times (configurable setting), and I get a 503 (HTTP error codes also configurable, but defaults to a 503), so instead of failing, display a WARNING that lets the user know that NVD couldn't be contacted because of a 503 error 10 times and that a local cached copy of the NVD database dated X is being used instead. The user should be able to decide if they want the failover to a cached copy of the NVD database to be allowed via a parameter (default is debatable, but I'd say false by default). This won't help users who still need to get a cached copy, but at least for those who do, things will keep working until NVD comes back online.

Lately, NVD's instability has made me want to build a local cache of the NVD DB. I haven't done this only because NVD has been fairly reliable.

@chadlwilson
Copy link
Contributor

It seems the NVD is broadly back up now (at least sufficiently to work off a cache or mirror), so perhaps we can close this to move discussion to more focused issues about improving the caching, addressing the retry strategy challenges and/or logging of retries?

The irony is that as @marcelstoer noted above in #6531 (comment) (thank you!) currently the NVD is not actually going to be feeding much (any?) useful new data to projects anyway, as few CVEs are being mapped to CPEs, making ODC unable to do much with the updates from NVD.

@marcelstoer
Copy link
Contributor

I second closing this issue.

@OrangeDog
Copy link

NVD is not actually going to be feeding much (any?) useful new data to projects anyway

People should look at sorting out a token for the OSSIndex feed if they haven't already.

@chadlwilson
Copy link
Contributor

chadlwilson commented Mar 22, 2024

NVD is not actually going to be feeding much (any?) useful new data to projects anyway

People should look at sorting out a token for the OSSIndex feed if they haven't already.

Hmm, that's interesting, because ODC wasn't highlighting https://ossindex.sonatype.org/vulnerability/CVE-2024-22257 to me via either NVD or OSSIndex (when I observed by contrast that Trivy-via-GHSA was) so I started to fear they may be relying upon NVD for more than we might have anticipated - but I do note it is mapped to products in OSSIndex now. I think there was just a bit delayed, which is somewhat reassuring about Sonatype's support/commitment.

@OrangeDog
Copy link

CVE-2024-22257

ODC told me about that on Wednesday, but I don't run it every day.

@jeremylong
Copy link
Owner

appears to be resolved on the NVD end.

@AndriusCv
Copy link

AndriusCv commented Mar 25, 2024

Unfortunately, NVD is acting up again after a few days of being stable...

@mahidharu
Copy link

mahidharu commented Mar 25, 2024

It seems like the NVD service is down again.

Running dependencyCheckAnalyze task using gradle plugin :

Plugin:
'org.owasp.dependencycheck' version '9.0.9'

dependencyCheck {
formats=['HTML','JSON']
nvd {
apiKey="<NVD_API_KEY>"
}
}

Implementing a local cache would be fail-safe for any outages from the NVD service.

@arnabcse28
Copy link
Author

yes facing this issue once again at my end...

I think followings could be options to pass through dependency-check stage while NVD is down if a hosted DB is not available:

cc: @jeremylong

@puni2k
Copy link

puni2k commented Mar 26, 2024

yes facing this issue once again at my end...

I think followings could be options to pass through dependency-check stage while NVD is down if a hosted DB is not available:

* CLI: Using "--noupdate" option while executing the CLI (reference: https://jeremylong.github.io/DependencyCheck/dependency-check-cli/arguments.html)

* For maven builds, adding "-DautoUpdate=false" in the maven command line option without need to update relevant pom.xml (reference: https://jeremylong.github.io/DependencyCheck/dependency-check-maven/check-mojo.html#autoUpdate)

cc: @jeremylong

We've been using -DnvdValidForHours=10000 during the previous downtime, so to only block NVD updates and not i.e. the supression list.
Obviously 10000 is entirely random and you can choose any number of your liking.

@password123456
Copy link

it seems that the NVD API occur HTTP 503 errors today

@OrangeDog
Copy link

Implementing a local cache

There is one, but #6535 prevents it being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests