Repository navigation
Deduplicate transparency-log entries when counting toward the threshold - #1702
Merged
Merged
Conversation
π¦ Changeset detectedLatest commit: 5ee3416 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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
approved these changes
Jul 30, 2026
Collaborator
There was a problem hiding this comment.
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>
Collaborator
|
Note that the Smoke Test CI failures here are expected given that this PR originates from a fork. |
ejahnGithub
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I do supply-chain security work and was reading through the
@sigstore/verifyverifier.Verifier.verifyTLogscounts each transparency-log entry towardtlogThresholdwith a plain counter and no distinctness check. The same verifier already guards against duplicates for the other two threshold-gated collections: timestamps go throughcontainsDupesbefore the timestamp threshold, and SCTs go throughcontainsDupesbefore the ctlog threshold. Tlog entries were the one collection left without that guard.In practice this only changes an outcome when a caller sets
tlogThresholdabove 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 timestampcontainsDupescheck. 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 existingcontainsDupeshelper 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: 2and asserts it now throwsTLOG_ERROR. It fails before the change (verify returns without error) and passes after.npx jest packages/verifyis green (155 tests), and prettier/eslint are clean on the touched files. Included a changeset.