Skip to content

Deduplicate transparency-log entries when counting toward the threshold - #1702

Merged
bdehamer merged 1 commit into
sigstore:mainfrom
arpitjain099:chore/dedup-tlog-entries
Jul 31, 2026
Merged

bdehamer merged 1 commit into
sigstore:mainfrom
arpitjain099:chore/dedup-tlog-entries

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

Hi, I do supply-chain security work and was reading through the @sigstore/verify verifier.

Verifier.verifyTLogs counts each transparency-log entry toward tlogThreshold with a plain counter and no distinctness check. The same verifier already guards against duplicates for the other two threshold-gated collections: timestamps go through containsDupes before the timestamp threshold, and SCTs go through containsDupes before the ctlog threshold. Tlog entries were the one collection left without that guard.

In practice this only changes an outcome when a caller sets tlogThreshold above the default of 1 (for example, to require witnessing by more than one log). At the default of 1 a single entry already satisfies the check and duplicating it buys nothing, so this is a hardening/consistency fix rather than a break in the common path. The existing "duplicate TLog entries" test passes today because that fixture's entry carries an inclusion promise, so the duplicate is caught earlier by the timestamp containsDupes check. Proof-only entries (the Rekor v2 default) produce no tlog timestamp, so they slip past that check and reach the tlog counter, where the repeat currently counts twice.

sigstore-go does the equivalent check ("disallow duplicate entries, as a malicious actor could use duplicates to bypass the threshold"), matching entries by log key ID and log index, so this also lines the two implementations up.

The change collects { logID, logIndex } per entry and runs the existing containsDupes helper over them before the threshold comparison, in the same shape as the timestamp and SCT checks right above it. Distinct entries (different log or different index) are unaffected.

Testing: added a case that repeats a single inclusion-proof entry with tlogThreshold: 2 and asserts it now throws TLOG_ERROR. It fails before the change (verify returns without error) and passes after. npx jest packages/verify is green (155 tests), and prettier/eslint are clean on the touched files. Included a changeset.

@arpitjain099
arpitjain099 requested a review from a team as a code owner July 18, 2026 16:02
@changeset-bot

changeset-bot Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

πŸ¦‹ Changeset detected

Latest commit: 5ee3416

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sigstore/verify Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bdehamer bdehamer left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the thoughtful contribution, @arpitjain099! Running containsDupes over the tlog entries before the threshold check brings them in line with the existing timestamp and SCT dedup guards.

The verifier counts each tlog entry toward tlogThreshold without checking
that the entries are distinct, while the same verifier already dedupes
timestamps and SCTs before applying their thresholds. As a result a caller
that raises tlogThreshold above 1 for extra assurance could have the check
satisfied by repeated copies of a single entry.

Reject duplicate tlog entries (matched by log ID and log index) before the
threshold comparison, mirroring the existing timestamp and SCT checks. Add a
test that repeats one inclusion-proof entry and asserts it no longer
over-counts.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@bdehamer

Copy link
Copy Markdown
Collaborator

Note that the Smoke Test CI failures here are expected given that this PR originates from a fork.

@bdehamer
bdehamer merged commit adbe253 into sigstore:main Jul 31, 2026
54 of 61 checks passed
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.

3 participants