Skip to content

fix(sarif): omit credential-shaped attested paths in PR #5 - #16

Draft
yashaskn8 wants to merge 2 commits into
feature/verified-sarif-export-2026from
fix/sarif5-reject-secret-evidence-paths-20261031
Draft

yashaskn8 wants to merge 2 commits into
feature/verified-sarif-export-2026from
fix/sarif5-reject-secret-evidence-paths-20261031

Conversation

@yashaskn8

Copy link
Copy Markdown
Owner

Verified source-path security risk

PR #5's backend/app/reporting/sarif.py::_safe_path rejects traversal, absolute paths and controls but does not apply the repository's contains_secrets detector to evidence paths. The SARIF builder then writes the URI returned by _safe_path into artifactLocation.uri. A canonically attested repository filename containing a recognizable token pattern (for example a synthetic ghp_-shaped filename) can therefore be serialized into the downloadable SARIF artifact. The existing is_canonical_confirmed_finding attestation check verifies provenance, not secret-free filenames. This is a confirmed code-path risk; no actual credential exposure has been observed.

Minimal change

  • Reuse app.security.redaction.contains_secrets in _safe_path to omit a finding with a credential-shaped evidence path rather than output a redacted/invalid URI.
  • Add an API-level regression test with synthetic GitHub-token and API-key-shaped filenames. Existing tests already cover a normal repository-relative path.

Validation / review required

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.

1 participant