Skip to content

Leads that differ only in fields outside the lead id are dropped silently #196

Backlog

Description

@TMHSDigital

Summary

The lead id is built from source, rule, file, line, method, endpoint and parameter only, and Unique keeps the first lead of an id and drops the rest with no count and no note. Two distinct results can share an id.

Where

  • internal/seed/seed.go:51 (Finalize), :205, :258-268 (Unique)
  • internal/seed/external.go:861, :955 (dependency leads: rule id advisory:package, no line)
  • internal/seed/secrets.go:69 (one lead per match, keyed by rule and line)

Details

Two cases. (1) osv-scanner and trivy dependency leads have no line, so the same advisory on two installed versions of one package in one lockfile (a nested and a top-level copy) is one id; the installed version is only in the title and detail. (2) The secret seeder emits one lead per match with the rule and line, so two credentials of the same rule on one line are one id; the fingerprint that tells them apart is only in the detail. Assumption for (1): the scanner lists each installed version as its own package entry.

Impact

The report names one affected version (or one credential fingerprint) where there are two, and the seeder status shows a lead count lower than what the scanner reported, with nothing saying a result was merged. Someone who upgrades or rotates only the one named can believe the finding is resolved.

Suggested fix

Put what distinguishes the results in the id: the version for dependency leads, and the match fingerprint or column for secret leads. Alternatively make Unique count what it drops and add that to the seeder's note, as capLeads does.

Acceptance criteria

  • Two versions of one package with the same advisory produce two leads
  • Two same-rule credentials on one line produce two leads
  • Anything Unique drops is counted in the seeder note

Related: #1, #39

Getting started

  • Relevant files: internal/seed/external.go, internal/seed/secrets.go, internal/seed/seed.go
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: bug|internal/seed/seed.go|Lead.Finalize

Activity

  1. added
    bug
    severity: low
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions