Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jf audit: SARIF format is missing most of the fields provided by the JSON format #2063

Open
marcandre-larochelle-bell opened this issue Jul 6, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@marcandre-larochelle-bell
Copy link

marcandre-larochelle-bell commented Jul 6, 2023

Describe the bug

SARIF format is not on-par with the JSON format.

Current behavior

SARIF format is missing most of the JSON format information:

  • No license (FOSS) information at all
  • CVSS Vector
  • Impacted paths
    • In-case of a multi-maven project, the uri is "pom.xml" (no module prefix) with startLine, startColumn and endLine set to 0.
  • Fixed versions
  • All of the extended information (from the R&D enrichment)
    • Haven't verified the contextual analysis, but my guess is, it is also missing
  • References

Note:

Reproduction steps

  1. Perform a scan with the JSON format
  2. Perform a scan with the SARIF format
  3. Compare the 2

Expected behavior

SARIF format is on-par with the JSON format in term of information provided.

JFrog CLI version

2.42.1

Operating system type and version

Docker

JFrog Artifactory version

No response

JFrog Xray version

No response

@marcandre-larochelle-bell marcandre-larochelle-bell added the bug Something isn't working label Jul 6, 2023
@marcandre-larochelle-bell marcandre-larochelle-bell changed the title SARIF format is missing most of the fields provided by the JSON format jf audit: SARIF format is missing most of the fields provided by the JSON format Jul 7, 2023
@efenglu
Copy link

efenglu commented Feb 2, 2024

Any update on this? I can't upload the jf audit sarif file to Github Security

@jonesbusy
Copy link

Hi,

I'm not sure if I have the same issue

I cannot import sarif report but on SonarQube.

It works for other dependencies checker (from maven) so I suspect the issue comes from the format of the jf client.

[15:29:34.192+02:00] - [INFO] 13:29:31.682 Sensor Import external issues report from SARIF file.
[15:29:34.192+02:00] - [WARNING] 13:29:31.769 Failed to import an issue raised by tool JFrog Xray SCA, error: URI has an authority component

This is my sarif report

Expand
{
  "version": "2.1.0",
  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
  "runs": [
    {
      "tool": {
        "driver": {
          "informationUri": "https://docs.jfrog-applications.jfrog.io/jfrog-security-features/sca",
          "name": "JFrog Xray SCA",
          "rules": [
            {
              "id": "CVE-2016-1000027_org.springframework:spring-web_5.3.31",
              "shortDescription": {
                "text": "[CVE-2016-1000027] org.springframework:spring-web 5.3.31"
              },
              "help": {
                "text": "Pivotal Spring Framework through 5.3.16 suffers from a potential remote code execution (RCE) issue if used for Java deserialization of untrusted data. Depending on how the library is implemented within a product, this issue may or not occur, and authentication may be required. NOTE: the vendor's position is that untrusted data is not an intended use case. The product's behavior will not be changed because some users rely on deserialization of trusted data.",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 9.8      | `org.springframework:spring-web 5.3.31`       | [6.0.0]   |"
              },
              "properties": {
                "security-severity": "9.8"
              }
            },
            {
              "id": "CVE-2024-22259_org.springframework:spring-web_5.3.31",
              "shortDescription": {
                "text": "[CVE-2024-22259] org.springframework:spring-web 5.3.31"
              },
              "help": {
                "text": "Applications that use UriComponentsBuilder in Spring Framework to parse an externally provided URL (e.g. through a query parameter) AND perform validation checks on the host of the parsed URL may be vulnerable to a  open redirect https://cwe.mitre.org/data/definitions/601.html  attack or to a SSRF attack if the URL is used after passing validation checks.\n\nThis is the same as  CVE-2024-22243 https://spring.io/security/cve-2024-22243 , but with different input.\n\n",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 8.1      | `org.springframework:spring-web 5.3.31`       | [5.3.33], [6.0.18], [6.1.5]   |"
              },
              "properties": {
                "security-severity": "8.1"
              }
            },
            {
              "id": "CVE-2024-22257_org.springframework.security:spring-security-core_5.8.9",
              "shortDescription": {
                "text": "[CVE-2024-22257] org.springframework.security:spring-security-core 5.8.9"
              },
              "help": {
                "text": "In Spring Security, versions 5.7.x prior to 5.7.12, 5.8.x prior to \n5.8.11, versions 6.0.x prior to 6.0.9, versions 6.1.x prior to 6.1.8, \nversions 6.2.x prior to 6.2.3, an application is possible vulnerable to \nbroken access control when it directly uses the AuthenticatedVoter#vote passing a null Authentication parameter.\n\n",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 8.2      | `org.springframework.security:spring-security-core 5.8.9`       | [5.7.12], [5.8.11], [6.1.8], [6.2.3]   |"
              },
              "properties": {
                "security-severity": "8.2"
              }
            },
            {
              "id": "CVE-2024-22243_org.springframework:spring-web_5.3.31",
              "shortDescription": {
                "text": "[CVE-2024-22243] org.springframework:spring-web 5.3.31"
              },
              "help": {
                "text": "Applications that use UriComponentsBuilder to parse an externally provided URL (e.g. through a query parameter) AND perform validation checks on the host of the parsed URL may be vulnerable to a  open redirect https://cwe.mitre.org/data/definitions/601.html  attack or to a SSRF attack if the URL is used after passing validation checks.\n",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 8.1      | `org.springframework:spring-web 5.3.31`       | [5.3.32], [6.0.17], [6.1.4]   |"
              },
              "properties": {
                "security-severity": "8.1"
              }
            },
            {
              "id": "CVE-2023-48795_org.apache.sshd:sshd-common_2.11.0",
              "shortDescription": {
                "text": "[CVE-2023-48795] org.apache.sshd:sshd-common 2.11.0"
              },
              "help": {
                "text": "The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6 and other products, allows remote attackers to bypass integrity checks such that some packets are omitted (from the extension negotiation message), and a client and server may consequently end up with a connection for which some security features have been downgraded or disabled, aka a Terrapin attack. This occurs because the SSH Binary Packet Protocol (BPP), implemented by these extensions, mishandles the handshake phase and mishandles use of sequence numbers. For example, there is an effective attack against SSH's use of ChaCha20-Poly1305 (and CBC with Encrypt-then-MAC). The bypass occurs in chacha20-poly1305@openssh.com and (if CBC is used) the -etm@openssh.com MAC algorithms. This also affects Maverick Synergy Java SSH API before 3.1.0-SNAPSHOT, Dropbear through 2022.83, Ssh before 5.1.1 in Erlang/OTP, PuTTY before 0.80, AsyncSSH before 2.14.2, golang.org/x/crypto before 0.17.0, libssh before 0.10.6, libssh2 through 1.11.0, Thorn Tech SFTP Gateway before 3.4.6, Tera Term before 5.1, Paramiko before 3.4.0, jsch before 0.2.15, SFTPGo before 2.5.6, Netgate pfSense Plus through 23.09.1, Netgate pfSense CE through 2.7.2, HPN-SSH through 18.2.0, ProFTPD before 1.3.8b (and before 1.3.9rc2), ORYX CycloneSSH before 2.3.4, NetSarang XShell 7 before Build 0144, CrushFTP before 10.6.0, ConnectBot SSH library before 2.2.22, Apache MINA sshd through 2.11.0, sshj through 0.37.0, TinySSH through 20230101, trilead-ssh2 6401, LANCOM LCOS and LANconfig, FileZilla before 3.66.4, Nova before 11.8, PKIX-SSH before 14.4, SecureCRT before 9.4.3, Transmit5 before 5.10.4, Win32-OpenSSH before 9.5.0.0p1-Beta, WinSCP before 6.2.2, Bitvise SSH Server before 9.32, Bitvise SSH Client before 9.33, KiTTY through 0.76.1.13, the net-ssh gem 7.2.0 for Ruby, the mscdex ssh2 module before 1.15.0 for Node.js, the thrussh library before 0.35.1 for Rust, and the Russh crate before 0.40.2 for Rust.",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 5.9      | `org.jenkins-ci.main:cli 2.440.2`       | No fix available   |"
              },
              "properties": {
                "security-severity": "5.9"
              }
            },
            {
              "id": "CVE-2023-48795_org.apache.sshd:sshd-core_2.11.0",
              "shortDescription": {
                "text": "[CVE-2023-48795] org.apache.sshd:sshd-core 2.11.0"
              },
              "help": {
                "text": "The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6 and other products, allows remote attackers to bypass integrity checks such that some packets are omitted (from the extension negotiation message), and a client and server may consequently end up with a connection for which some security features have been downgraded or disabled, aka a Terrapin attack. This occurs because the SSH Binary Packet Protocol (BPP), implemented by these extensions, mishandles the handshake phase and mishandles use of sequence numbers. For example, there is an effective attack against SSH's use of ChaCha20-Poly1305 (and CBC with Encrypt-then-MAC). The bypass occurs in chacha20-poly1305@openssh.com and (if CBC is used) the -etm@openssh.com MAC algorithms. This also affects Maverick Synergy Java SSH API before 3.1.0-SNAPSHOT, Dropbear through 2022.83, Ssh before 5.1.1 in Erlang/OTP, PuTTY before 0.80, AsyncSSH before 2.14.2, golang.org/x/crypto before 0.17.0, libssh before 0.10.6, libssh2 through 1.11.0, Thorn Tech SFTP Gateway before 3.4.6, Tera Term before 5.1, Paramiko before 3.4.0, jsch before 0.2.15, SFTPGo before 2.5.6, Netgate pfSense Plus through 23.09.1, Netgate pfSense CE through 2.7.2, HPN-SSH through 18.2.0, ProFTPD before 1.3.8b (and before 1.3.9rc2), ORYX CycloneSSH before 2.3.4, NetSarang XShell 7 before Build 0144, CrushFTP before 10.6.0, ConnectBot SSH library before 2.2.22, Apache MINA sshd through 2.11.0, sshj through 0.37.0, TinySSH through 20230101, trilead-ssh2 6401, LANCOM LCOS and LANconfig, FileZilla before 3.66.4, Nova before 11.8, PKIX-SSH before 14.4, SecureCRT before 9.4.3, Transmit5 before 5.10.4, Win32-OpenSSH before 9.5.0.0p1-Beta, WinSCP before 6.2.2, Bitvise SSH Server before 9.32, Bitvise SSH Client before 9.33, KiTTY through 0.76.1.13, the net-ssh gem 7.2.0 for Ruby, the mscdex ssh2 module before 1.15.0 for Node.js, the thrussh library before 0.35.1 for Rust, and the Russh crate before 0.40.2 for Rust.",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 5.9      | `org.jenkins-ci.main:cli 2.440.2`       | No fix available   |"
              },
              "properties": {
                "security-severity": "5.9"
              }
            },
            {
              "id": "XRAY-589059_org.jfree:jcommon_1.0.23",
              "shortDescription": {
                "text": "[XRAY-589059] org.jfree:jcommon 1.0.23"
              },
              "help": {
                "text": "This package may be vulnerable to the MavenGate attack",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 0.0      | `org.jfree:jcommon 1.0.23`       | No fix available   |"
              },
              "properties": {
                "security-severity": "0.0"
              }
            },
            {
              "id": "XRAY-589059_org.slf4j:slf4j-api_2.0.11",
              "shortDescription": {
                "text": "[XRAY-589059] org.slf4j:slf4j-api 2.0.11"
              },
              "help": {
                "text": "This package may be vulnerable to the MavenGate attack",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 0.0      | `org.jenkins-ci.main:cli 2.440.2`       | No fix available   |"
              },
              "properties": {
                "security-severity": "0.0"
              }
            },
            {
              "id": "XRAY-589059_com.jcraft:jzlib_1.1.3-kohsuke-1",
              "shortDescription": {
                "text": "[XRAY-589059] com.jcraft:jzlib 1.1.3-kohsuke-1"
              },
              "help": {
                "text": "This package may be vulnerable to the MavenGate attack",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 0.0      | `com.jcraft:jzlib 1.1.3-kohsuke-1`       | No fix available   |"
              },
              "properties": {
                "security-severity": "0.0"
              }
            },
            {
              "id": "XRAY-589059_org.slf4j:jcl-over-slf4j_2.0.11",
              "shortDescription": {
                "text": "[XRAY-589059] org.slf4j:jcl-over-slf4j 2.0.11"
              },
              "help": {
                "text": "This package may be vulnerable to the MavenGate attack",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 0.0      | `org.jenkins-ci.main:cli 2.440.2`       | No fix available   |"
              },
              "properties": {
                "security-severity": "0.0"
              }
            },
            {
              "id": "XRAY-589059_org.slf4j:slf4j-jdk14_2.0.11",
              "shortDescription": {
                "text": "[XRAY-589059] org.slf4j:slf4j-jdk14 2.0.11"
              },
              "help": {
                "text": "This package may be vulnerable to the MavenGate attack",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 0.0      | `org.jenkins-ci.main:cli 2.440.2`       | No fix available   |"
              },
              "properties": {
                "security-severity": "0.0"
              }
            },
            {
              "id": "XRAY-589059_org.jfree:jfreechart_1.0.19",
              "shortDescription": {
                "text": "[XRAY-589059] org.jfree:jfreechart 1.0.19"
              },
              "help": {
                "text": "This package may be vulnerable to the MavenGate attack",
                "markdown": "| Severity Score | Direct Dependencies | Fixed Versions     |\n| :---:        |    :----:   |          :---: |\n| 0.0      | `org.jfree:jfreechart 1.0.19`       | No fix available   |"
              },
              "properties": {
                "security-severity": "0.0"
              }
            }
          ],
          "version": "3.69.3"
        }
      },
      "results": [
        {
          "ruleId": "CVE-2016-1000027_org.springframework:spring-web_5.3.31",
          "ruleIndex": 0,
          "level": "error",
          "message": {
            "text": "[CVE-2016-1000027] org.springframework:spring-web 5.3.31"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "CVE-2024-22259_org.springframework:spring-web_5.3.31",
          "ruleIndex": 1,
          "level": "error",
          "message": {
            "text": "[CVE-2024-22259] org.springframework:spring-web 5.3.31"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "CVE-2024-22257_org.springframework.security:spring-security-core_5.8.9",
          "ruleIndex": 2,
          "level": "error",
          "message": {
            "text": "[CVE-2024-22257] org.springframework.security:spring-security-core 5.8.9"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "CVE-2024-22243_org.springframework:spring-web_5.3.31",
          "ruleIndex": 3,
          "level": "error",
          "message": {
            "text": "[CVE-2024-22243] org.springframework:spring-web 5.3.31"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "CVE-2023-48795_org.apache.sshd:sshd-common_2.11.0",
          "ruleIndex": 4,
          "level": "warning",
          "message": {
            "text": "[CVE-2023-48795] org.jenkins-ci.main:cli 2.440.2"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "CVE-2023-48795_org.apache.sshd:sshd-core_2.11.0",
          "ruleIndex": 5,
          "level": "warning",
          "message": {
            "text": "[CVE-2023-48795] org.jenkins-ci.main:cli 2.440.2"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "XRAY-589059_org.jfree:jcommon_1.0.23",
          "ruleIndex": 6,
          "level": "note",
          "message": {
            "text": "[XRAY-589059] org.jfree:jcommon 1.0.23"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "XRAY-589059_org.slf4j:slf4j-api_2.0.11",
          "ruleIndex": 7,
          "level": "note",
          "message": {
            "text": "[XRAY-589059] org.jenkins-ci.main:cli 2.440.2"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "XRAY-589059_com.jcraft:jzlib_1.1.3-kohsuke-1",
          "ruleIndex": 8,
          "level": "note",
          "message": {
            "text": "[XRAY-589059] com.jcraft:jzlib 1.1.3-kohsuke-1"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "XRAY-589059_org.slf4j:jcl-over-slf4j_2.0.11",
          "ruleIndex": 9,
          "level": "note",
          "message": {
            "text": "[XRAY-589059] org.jenkins-ci.main:cli 2.440.2"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "XRAY-589059_org.slf4j:slf4j-jdk14_2.0.11",
          "ruleIndex": 10,
          "level": "note",
          "message": {
            "text": "[XRAY-589059] org.jenkins-ci.main:cli 2.440.2"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        },
        {
          "ruleId": "XRAY-589059_org.jfree:jfreechart_1.0.19",
          "ruleIndex": 11,
          "level": "note",
          "message": {
            "text": "[XRAY-589059] org.jfree:jfreechart 1.0.19"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file://Package-Descriptor"
                }
              }
            }
          ]
        }
      ]
    }
  ]
}

@jonesbusy
Copy link

@smals-maxmi
Copy link

smals-maxmi commented Jun 24, 2024

To make it work for Sonar , had to remove the file:// in uri artifact path... But same issue with multi module maven project. It is missing the correct path for the module. The sarif format could use some improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants