Skip to content

Conversation

@cosmir17
Copy link
Contributor

@cosmir17 cosmir17 commented Dec 29, 2025

GitHub Code Scanning requires at least one location per SARIF result, but some diagnostics (e.g., dependency advisories) only reference Cargo.lock which is filtered out, leaving an empty locations array.

This adds a fallback location pointing to Cargo.toml line 1 when no locations exist.

Fixes compatibility with github/codeql-action/upload-sarif.

cc'ing @gilescope

@cosmir17 cosmir17 force-pushed the fix-sarif-empty-locations branch 2 times, most recently from ac4a373 to 02d64e2 Compare January 5, 2026 17:01
Instead of hardcoding "Cargo.toml", use the workspace root path to
construct the fallback location URI. This ensures the location points
to an actual file in the workspace.
@cosmir17 cosmir17 force-pushed the fix-sarif-empty-locations branch 2 times, most recently from 8eec434 to ff4dfd6 Compare January 5, 2026 17:26
The gix-date 0.11.0 vulnerability (TimeBuf::as_str can create non-UTF8
strings) is introduced via tame-index 0.25.0 which pins gix 0.75.0.

Cannot update gix directly as it would conflict with tame-index's
gix dependency. Ignoring until tame-index releases an update with
gix 0.77+.
@cosmir17 cosmir17 force-pushed the fix-sarif-empty-locations branch from ff4dfd6 to 6b03985 Compare January 5, 2026 17:31
Copy link
Member

@Jake-Shadle Jake-Shadle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to point to the locations in each manifest that directly depends on the crate in question, but I don't really care about SARIF so someone can do that later if they want, I presume this is just to get past the github requirement more than anything.

@Jake-Shadle Jake-Shadle merged commit c7057a0 into EmbarkStudios:main Jan 8, 2026
12 checks passed
@cosmir17
Copy link
Contributor Author

cosmir17 commented Jan 8, 2026

Thanks for merging! You're right - this is primarily to satisfy GitHub's location requirement. The direct-dependency approach would be more informative for users investigating vulnerabilities.

cosmir17 added a commit to midnightntwrk/midnight-indexer that referenced this pull request Jan 8, 2026
cargo-deny 0.19.0 now includes a fix for empty locations in SARIF
output (EmbarkStudios/cargo-deny#819). The jq workaround that added
Cargo.lock as a fallback location is no longer needed.
gilescope pushed a commit to midnightntwrk/midnight-indexer that referenced this pull request Jan 8, 2026
cargo-deny 0.19.0 now includes a fix for empty locations in SARIF
output (EmbarkStudios/cargo-deny#819). The jq workaround that added
Cargo.lock as a fallback location is no longer needed.
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 this pull request may close these issues.

2 participants