Description
Hi,
Currently, DefectDojo only "supports" CVSS Version 3.x. By "support," I mean that the fields in the Findings model and the integrated CVSS score calculator are specifically named and structured around CVSS v3. In the past, there have already been separate issues discussing support for different CVSS versions (e.g., #9378 and #12365). Now that CVSS 4.0 is gaining broader adoption (e.g., the EUVD uses it), this topic is becoming more relevant. I think it would be practical to have a version-agnostic way of storing score and vector data, since this would allow users to freely choose which CVSS version to use without modifying the DefectDojo data model or having contradictory information in field names.
A previous, now-closed approach (see #9380) proposed adding new CVSS-specific fields to the Findings model. In my opinion, this kind of solution risks cluttering the model over time as more versions emerge.
Proposed Solution:
I propose a refactor of how CVSS data is stored in the Findings model. Instead of embedding the CVSS version into the field names, DefectDojo should generalize the field structure and store only the version agnostic core data:
- cvss_vector instead of cvssv3
- cvss_score instead of cvssv3_score
Additionally, I suggest introducing a new field: cvss_version, which would explicitly store the CVSS version used. Ideally, this field wouldn’t be necessary—since the version is usually part of the vector—but some data sources (e.g., OpenVAS CSV reports) do not include the vector, only a numeric score. In such cases, being able to specify the version used to generate the score could be useful (especially if there would be an "Unknown" version choice). Another benefit of having a separate cvss_version field is that it allows users to explicitly choose which CVSS version to use when manually adding a finding. However, one could argue that this could be handled purely as a UI feature, with the CVSS version inferred from the score prefix—since using the prefix is part of the specification. That said, this approach could introduce complications if the vector needs to be processed further.
Advantages:
Ideally, this approach enables the easy addition of future CVSS versions (simply add a new value to the allowed values like in the severity field), as long as the underlying paradigm of score and vector remains consistent. Furthermore, it allows users to freely choose a CVSS version while maintaining clean and consistent variable naming in both the UI and source code.
Disadvantages:
This change may break compatibility for applications relying on the current DefectDojo API. However, it should be feasible to map cvssv3_score and cvssv3 to the new generalized fields (cvss_score, cvss_vector) and provide a deprecation warning, with full removal in a future major release.
I’d would be happy to hear/read the thoughts of the community and maintainers on this approach. I’m willing to implement the change myself if it receives sufficient approval (I believe it may touch files currently affected by the feature freeze).