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

SARIF output malformed due to incorrect URI, which causes GitHub upload to fail #78

Open
Robyt3 opened this issue Jul 24, 2023 · 1 comment · May be fixed by #88
Open

SARIF output malformed due to incorrect URI, which causes GitHub upload to fail #78

Robyt3 opened this issue Jul 24, 2023 · 1 comment · May be fixed by #88

Comments

@Robyt3
Copy link

Robyt3 commented Jul 24, 2023

GitHub workflow file:

name: Flawfinder

on:
  push:
    branches: [master]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [master]
  schedule:
    - cron: '28 13 * * 2'

jobs:
  flawfinder:
    name: Flawfinder
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Scan with Flawfinder
        uses: david-a-wheeler/[email protected]
        with:
          arguments: '--sarif ./src'
          output: 'flawfinder_results.sarif'

      - name: Upload analysis results to GitHub Security tab
        uses: github/codeql-action/upload-sarif@v2
        with:
          sarif_file: ${{github.workspace}}/flawfinder_results.sarif

The upload step fails with this output:

Run github/codeql-action/upload-sarif@v2
Uploading results
  Processing sarif files: ["/home/runner/work/ddnet/ddnet/flawfinder_results.sarif"]
Error details: instance.runs[0].tool.driver.rules[18].helpUri does not conform to the "uri" format
Error: Unable to upload "/home/runner/work/ddnet/ddnet/flawfinder_results.sarif" as it is not valid SARIF:
- instance.runs[0].tool.driver.rules[18].helpUri does not conform to the "uri" format
Error: Unable to upload "/home/runner/work/ddnet/ddnet/flawfinder_results.sarif" as it is not valid SARIF:
- instance.runs[0].tool.driver.rules[18].helpUri does not conform to the "uri" format
    at validateSarifFileSchema (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-lib.js:199:15)
    at uploadFiles (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-lib.js:249:9)
    at Object.uploadFromActions (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-lib.js:136:18)
    at async run (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-sarif-action.js:48:30)
    at async runWrapper (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-sarif-action.js:70:9)

Relevant excerpt from the SARIF output:

{
  "id": "FF1030",
  "name": "race/access",
  "shortDescription": {
    "text": "This usually indicates a security flaw.  If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!)."
  },
  "defaultConfiguration": {
    "level": "error"
  },
  "helpUri": "https://cwe.mitre.org/data/definitions/362.htmlhttps://cwe.mitre.org/data/definitions/367.html",
  "relationships": [
    {
      "target": {
        "id": "CWE-362",
        "toolComponent": {
          "name": "CWE",
          "guid": "FFC64C90-42B6-44CE-8BEB-F6B7DAE649E5"
        }
      },
      "kinds": [
        "relevant"
      ]
    },
    {
      "target": {
        "id": "CWE-367",
        "toolComponent": {
          "name": "CWE",
          "guid": "FFC64C90-42B6-44CE-8BEB-F6B7DAE649E5"
        }
      },
      "kinds": [
        "incomparable"
      ]
    }
  ]
},
@cooljeanius
Copy link

dup of #66 perhaps?

dkt01 added a commit to dkt01/flawfinder that referenced this issue Jul 25, 2024
Allow '/' delimiter for CWE list to generate proper helouri entries for FF1026 & FF1030
Fixes david-a-wheeler#78
@dkt01 dkt01 linked a pull request Jul 25, 2024 that will close this issue
dkt01 added a commit to dkt01/flawfinder that referenced this issue Jul 25, 2024
Allow '/' delimiter for CWE list to generate proper helouri entries for FF1026 & FF1030
Fixes david-a-wheeler#78

Signed-off-by: David K Turner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants