Skip to content

Accept SCTs only from CT logs in a trusted state - #238

Open
ai-13rac1 wants to merge 3 commits into
13rac1:mainfrom
ai-13rac1:ct-log-state
Open

ai-13rac1 wants to merge 3 commits into
13rac1:mainfrom
ai-13rac1:ct-log-state

Conversation

@ai-13rac1

Copy link
Copy Markdown
Contributor

Problem

Refs #236.

Teep's CT check loads Google's list of all known CT logs (all_logs_list.json) and accepts an SCT from any listed log, whatever its state. Test logs without a state, pending logs and rejected logs count the same as usable and qualified logs, for RFC 6962 logs and tiled logs alike. One SCT that verifies is enough.

With a mis-issued certificate and one SCT from a listed log that nobody monitors for real certificates, a connection passes the CT check. Through rekor.sigstore.dev, such a certificate would let an attacker forge Rekor answers and defeat the Sigstore factors.

Change

  • internal/tlsct/checker.go: findLog returns the key, state and temporal interval of the log, from either log collection. An SCT counts only when:

    • its log is usable or qualified, or readonly or retired and the SCT was issued before that state began; and
    • when the log has a temporal_interval, the certificate's NotAfter falls inside it.

    A pending, rejected or stateless log does not count. The error for a log ID outside the list now says "not found in the CT log list".

  • An SCT dated more than a day before the certificate's NotBefore, or more than an hour in the future, does not count. Without this bound, the holder of a retired or read-only log's key could date an SCT before the state change.

  • A log ID listed more than once, a log ID that is not the SHA-256 of its key (the SCT signature does not cover the log ID), and an entry with more than one state do not count.

  • The test log lists in tiled_logs_test.go and checker_test.go give their logs a usable state.

  • TestCheckTLSState_LogState covers each state, the interval and their boundaries, for RFC 6962 and tiled logs. TestCheckTLSState_SCTTime, TestCheckTLSState_DuplicateLogID and TestCheckTLSState_MalformedLogEntry cover the other rules.

  • docs/transport/README.md and docs/transport/testing.md state the rule and the test.

Effect

A certificate whose only verifying SCTs come from logs Chrome does not trust now fails the CT check.

The current rekor.sigstore.dev certificate (issued 2026-11-14) carries SCTs from Let's Encrypt Sycamore2027h1 and Geomys Tuscolo2027h1. Both logs are usable in Google's list of 2026-11-14, and the certificate's NotAfter (2027-02-12) falls inside both of their intervals, so it still passes. On 2026-11-14 Google's list held no entry that these rules refuse: every log ID was the hash of its key, no ID appeared twice, and no entry set more than one state.

Not in this change: a minimum number of SCTs from distinct logs and operators, as Chrome requires, and a signed, strictly decoded log list.

This change builds on the regression test for tiled logs in #234 and merges after it.

To verify

go test -race ./internal/tlsct -run 'TestCheckTLSState'
make check

Without the state check, the pending, rejected, stateless, late read-only, late retired and out-of-interval cases of TestCheckTLSState_LogState pass the CT check.

Checklist

  • I added unit tests for new code and regression tests for fixed bugs.
  • make check passes.
  • For a major feature: make integration and make reports pass.
  • I updated the documentation that this change affects.

ai-13rac1 and others added 3 commits November 15, 2026 17:47
… only

The certificate that rekor.sigstore.dev serves since 2026-11-14 carries
only SCTs from Static CT API (tiled) logs, and the CT check refused it
until tiled logs were looked up. This adds a regression test for that
case: a log list with one tiled log only and an SCT that the log signed,
with the leaf_index extension that a tiled log adds. The SCT passes. An
SCT with the tiled log's ID but another key's signature fails on the
signature, not on the lookup, and an SCT of a log that is not listed
fails.

To verify: go test ./internal/tlsct -run TestCheckTLSState_TiledLogSCT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CT check loads Google's list of all known CT logs and accepted an
SCT from any listed log, whatever its state: test logs without a state,
pending logs and rejected logs counted the same as usable logs, for
RFC 6962 logs and tiled logs alike. With a mis-issued certificate and
one SCT from a log that nobody monitors for real certificates, a
connection passed the CT check.

An SCT now counts only when its log is usable or qualified, or
read-only or retired with the SCT issued before that state began, and,
when the log has a temporal interval, the certificate expires inside
it. The error for a log ID outside the list now names the CT log list,
not a trusted log list. The test log lists now give their logs a usable
state. The transport reference states the rule.

The two tiled logs whose SCTs rekor.sigstore.dev carries since
2026-11-14 are usable in Google's list of that day, and the certificate
expires inside both of their intervals.

To verify: go test ./internal/tlsct -run 'TestCheckTLSState_LogState|TestCheckTLSState_TiledLogSCT|TestCheckTLSState_LogCollections'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retired or read-only log counts for an SCT issued before its state
changed, and the SCT timestamp comes from the log. The holder of such a
log's key could therefore date an SCT before the state change, and one
SCT is enough. A log ID that the list held twice let the state of the
first entry hide the state of the second. An entry with more than one
state was read by its first state, and a log ID was never checked
against its key, which the SCT signature does not cover.

An SCT dated more than a day before the certificate's NotBefore, or more
than an hour in the future, now does not count. A log ID listed more
than once, a log ID that is not the hash of its key, and an entry with
more than one state do not count. The tests cover these rules, and
the state and interval boundaries; the test helper has a neutral name.
On 2026-11-14 Google's list held no entry that these rules refuse.

To verify: go test ./internal/tlsct -run 'TestCheckTLSState_SCTTime|TestCheckTLSState_DuplicateLogID|TestCheckTLSState_MalformedLogEntry|TestCheckTLSState_LogState'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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