Skip to content

JFrog XRay JSON parser don't support CVSSv3 and CWE correctly #3597

Closed

Description

@damiencarol

Bug description
When we import a report with CWE number, there are not read correctly due to a bug in int conversion:

In parser.py:

cwe = vulnerability['component_versions']['more_details']['cves'][0]['cwe'][0].split('-')[1]
# some can be "NVD-CWE-noinfo"
            if not type(cwe) is int:
                cwe = 0

This can't work. cwe is always a string like "20" when the CWE is CWE-20.

Steps to reproduce
Steps to reproduce the behavior:

  1. Import a JFrog scan with finding with CWE number and/or CVSS v3 string
  2. Search the finding and there is no CWE number associated or CVSS v3 string

Expected behavior
We can see CWE number and CVSS v3 string.

Deployment method

  • Docker

Environment information

  • Operating System: Ubuntu 18.04
  • DefectDojo Version: 1.11.0

Sample scan files (optional)
The existing ones (many_vulns.json) show also the bug

Additional context (optional)
Found when adding unit tests for the parser with checks to the attributes of the Finding

Activity

  1. changed the title [-]JFrog XRay JSON don't support CVSSv3 and CWE correctly[/-] [+]JFrog XRay JSON parser don't support CVSSv3 and CWE correctly[/+] on Jan 6, 2021
  2. self-assigned this
    on Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions