Repository navigation
fix(security): repair scanners and remove vulnerable Gradio 3.x - #6
Conversation
Reviewer's GuideUses of the APIMigrate the Space’s model call from the removed legacy InferenceApi to InferenceClient and adapt generation arguments and output handling.
ConfigurationUpdate scanner workflows to use supported actions and invocation formats, grant required SARIF permissions, safely gate optional integrations, and avoid uploading missing reports.
Raise the Space’s Gradio and HTTP transport dependency floors to remove the vulnerable Gradio 3.x line and flagged transport versions.
TestsAdd a Python-version matrix smoke check that compiles the Space and verifies its imports and dependency security floors.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/mobsf.yml" line_range="35" />
<code_context>
- name: Upload mobsfscan report
- uses: github/codeql-action/upload-sarif@v3
+ if: always() && hashFiles('results.sarif') != ''
+ uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
with:
</code_context>
<issue_to_address>
**Failed scans appear successful**
When mobSF or PHPMD fails before writing its SARIF file, `|| true`, `continue-on-error`, and the SARIF guard suppress the scanner failure and skip the upload, so the workflow reports success without scan results.
Make scanner failures fail the workflow instead of silently skipping the upload when SARIF is missing.
Also at `.github/workflows/phpmd.yml:37`.
</issue_to_address>
### Comment 2
<location path=".github/workflows/defender-for-devops.yml" line_range="36" />
<code_context>
+ uses: microsoft/security-devops-action@v1.6.0
+ id: msdo
+ - name: Upload results to Security tab
+ uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
+ with:
+ sarif_file: ${{ steps.msdo.outputs.sarifFile }}
</code_context>
<issue_to_address>
**Fork reports are not uploaded**
When a pull request comes from a fork, the read-only `GITHUB_TOKEN` makes `upload-sarif` fail with a permission error, so the scan reports are not uploaded.
Add fork-specific handling for SARIF uploads so the read-only token does not make the upload fail.
Also at `.github/workflows/mobsf.yml:36-37`, `.github/workflows/phpmd.yml:38`.
</issue_to_address>Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: .github/workflows/mobsf.yml:35, .github/workflows/defender-for-devops.yml:36
|
|
||
| - name: Upload mobsfscan report | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| if: always() && hashFiles('results.sarif') != '' |
There was a problem hiding this comment.
🟡 Medium · Failed scans appear successful
When mobSF or PHPMD fails before writing its SARIF file, || true, continue-on-error, and the SARIF guard suppress the scanner failure and skip the upload, so the workflow reports success without scan results.
Make scanner failures fail the workflow instead of silently skipping the upload when SARIF is missing.
Also at .github/workflows/phpmd.yml:37.
Prompt for AI agents
In `.github/workflows/mobsf.yml` at line 35:
**Failed scans appear successful**
When mobSF or PHPMD fails before writing its SARIF file, `|| true`, `continue-on-error`, and the SARIF guard suppress the scanner failure and skip the upload, so the workflow reports success without scan results.
Make scanner failures fail the workflow instead of silently skipping the upload when SARIF is missing.
Also at `.github/workflows/phpmd.yml:37`.| uses: microsoft/security-devops-action@v1.6.0 | ||
| id: msdo | ||
| - name: Upload results to Security tab | ||
| uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4 |
There was a problem hiding this comment.
🟡 Medium · Fork reports are not uploaded
When a pull request comes from a fork, the read-only GITHUB_TOKEN makes upload-sarif fail with a permission error, so the scan reports are not uploaded.
Add fork-specific handling for SARIF uploads so the read-only token does not make the upload fail.
Also at .github/workflows/mobsf.yml:36-37, .github/workflows/phpmd.yml:38.
Prompt for AI agents
In `.github/workflows/defender-for-devops.yml` at line 36:
**Fork reports are not uploaded**
When a pull request comes from a fork, the read-only `GITHUB_TOKEN` makes `upload-sarif` fail with a permission error, so the scan reports are not uploaded.
Add fork-specific handling for SARIF uploads so the read-only token does not make the upload fail.
Also at `.github/workflows/mobsf.yml:36-37`, `.github/workflows/phpmd.yml:38`.
Summary
InferenceApicall toInferenceClient.httpx2>=2.12.0andhttpcore2>=2.12.0to address all six OSV findings previously reported against 2.9.1.continue-on-errorso scanner failures cannot be reported as success.Validation
Safety