fix: don't fail deserializing the document if CVSS can't be parsed#1
fix: don't fail deserializing the document if CVSS can't be parsed#1dejanb wants to merge 1 commit intoscm-rs:mainfrom
Conversation
Currently the deserialization of the document fails if CVSS v3 can't be parsed. This can happen if the CVSS vector string is malformed or parsing library can't properly handle the value (like temporal scores for CVSS v3). Instead of failing, we should store the original vector string and the score, so that the user can get the original values and handle them as needed. This will also allow us to to have the original CVSS vector strings in the output for versions currently not supported by the CVSS library and enable future support for CVSS v4 in CSAF more easily.
|
I somehow doubt that a change like that would ever go into upstream. Which means that having that patch and using that logic, we'd forever need to maintain our own fork. I don't think that's wise. Instead of taking a shortcut like this, we should go and actually implement what is missing. |
|
I don't think it's a shortcut, the v2 is already returning just a raw value and all other libraries we are using (cve and osv) let the score handling to the client as well. For example, for our use case, I would like to have original vector string from the document, which would currently be impossible without deserialize/serialize everything (which would not guarantee that we would get the original value for all use cases). The uplstream of this library seems to be abandoned project, so the maintenance is on us . Should we move this I was thinking to go back to If a change like this is too much, I would see to at least make the client library can recover from this error gracefully and get the original score(s) in the error that it can handle on its own. It will take a bit more time for the cvss library to be able to support all versions properly, so this issue will come up regularly. |
|
I agree that we should take ownership (or fork) that library. And I think it's ok to just define this as a |
Currently the deserialization of the document fails if CVSS v3 can't be parsed. This can happen if the CVSS vector string is malformed or parsing library can't properly handle the value (like temporal scores for CVSS v3).
Instead of failing, we should store the original vector string and the score, so that the user can get the original values and handle them as needed. This will also allow us to to have the original CVSS vector strings in the output for versions currently not supported by the CVSS library and enable future support for CVSS v4 in CSAF more easily.