RedHatProductSecurity / cvss-v4-calculator

CVSS v4.0 calculator

Home Page:https://redhatproductsecurity.github.io/cvss-v4-calculator/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor to reduce dependency on Vue

Chris-Turner-NIST opened this issue · comments

Would it be possible to refactor this code so the CVSS V4 score function can be called as a JavaScript function without the dependency on Vue?

Hey Christopher, what about https://github.com/pandatix/js-cvss aka NPM @pandatix/js-cvss ?

Chandan used it for Vulnogram upcoming release and was very happy about it :)

I think a better solution would be to refactor the calculator to split up the core value (CVSS V4 functionalities) from the GUI.

Hey Lucas, thanks for the quick response! We are currently looking into this repository for our calculator page and were already aware of the hard work you did for https://github.com/pandatix/js-cvss. Our preference is to avoid using two sets of "truth". As you seem to understand, the way things are currently written aren't friendly for alternative use cases of the CVSS v4 functionalities.

Re:

I think a better solution would be to refactor the calculator to split up the core value (CVSS V4 functionalities) from the GUI.

No disagreement here 😄

If someone would try to integrate js-cvss into this project or make a different attempt to decouple math from GUI so it still runs without build steps, then I would be happy to look at it.

Also in for this. I'm not using vue (nor do I want to) and I need to implement v4 into a Rails app. The previous v3.0 and v3.1 were a lot more developer-friendly. I'll take a look at js-cvss but it'd be nice to run the official script.

@MattBudz You could use https://github.com/RedHatProductSecurity/cvss as a base. It is written in Python and has a lot of tests for v4.0 generated using the Javascript implementation.