org-metaeffekt / metaeffekt-universal-cvss-calculator

A TypeScript implementation of CVSS 2.0, 3.0, 3.1 and 4.0, alongside a web application for calculating scores for multiple CVSS vectors simultaneously.

Home Page:https://metaeffekt.com/security/cvss/calculator/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NVD API CORS Errors

YanWittmann opened this issue · comments

Initially, when the web application was developed, the fetch-requests to the NVD 2.0 API endpoints worked almost flawlessly every time (under the constraints of the request limit of 1 request per 6 seconds).

Now, it seems almost impossible for the requests to pass through the CORS of the NVD API, with each request failing:

Screenshot 2024-02-26 at 09 49 16

This is a weird behavior that I would not expect. This issue will attempt to find a solution for this.

This actually seems to be the case. I can confirm that I have a significantly higher success rate with the XMLHttpRequest. I'm not sure why though - I thought the fetch API did everything the XMLHttpRequests do, but better?

Maybe it is just that - they do more. Maybe it's the pre-flight OPTIONS request? Maybe it's the NVD 2.0 API that just rejects requests from the fetch API? I can't say that for certain.

I can consistently fetch the vectors now using the technique explained above.