Skip to content

Bugfix hunt - #932

Open
robstradling wants to merge 12 commits into
transparency-dev:mainfrom
robstradling:bugfix-hunt
Open

Bugfix hunt#932
robstradling wants to merge 12 commits into
transparency-dev:mainfrom
robstradling:bugfix-hunt

Conversation

@robstradling

Copy link
Copy Markdown

I asked Claude to "Hunt for any obvious bugs, and suggest fixes."

len(m) was read outside the mutex while other goroutines wrote to the map
under mu.Lock(), which is a concurrent map read/write.
The retry limit was hardcoded to 10, so the caller-supplied value was
silently ignored.
Using %v broke the error chain, so PartialOrFullResource never saw
os.ErrNotExist and the partial-to-full bundle fallback never fired.
len(rest) was tested first, so a malformed checkpoint could be reported
as trailing data rather than the actual parse error.
The unit was tested first, so a parse failure could be reported as a
bogus unit error.
The ExtKeyUsageAny short-circuit ran before the empty-chain check, so an
unverifiable chain could be reported as success.
The value recorded and the bucket boundaries are both in seconds, but the
metric was labelled ms.
pem.Decode returns no error, so the check tested the already-nil err from
the preceding ReadFile and a non-PEM key file panicked on block.Bytes.
A short response from the source log made bits[1]/bits[2] panic with an
index out of range.
A short response from the source log made bits[1]/bits[2] panic with an
index out of range.
A fingerprint list whose length was not a multiple of 32 made the
fpRaw[:32] slice panic on data fetched from a remote log.
The bounds check was against rest, but the three bytes were read from
data, so any Uint24 field at a non-zero offset decoded the wrong bytes.
@robstradling
robstradling requested a review from a team as a code owner September 2, 2026 15:38
@robstradling
robstradling requested review from mhutchinson and removed request for a team September 2, 2026 15:38
@mhutchinson
mhutchinson requested review from roger2hk and removed request for mhutchinson September 2, 2026 15:46

@roger2hk roger2hk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @robstradling for the fix. The bug in internal/types/tls/tls.go can also be found in ct-go repo.

https://github.com/google/certificate-transparency-go/blob/master/tls/tls.go#L339

@robstradling

Copy link
Copy Markdown
Author

The bug in internal/types/tls/tls.go can also be found in ct-go repo.

I've opened a PR to fix that: google/certificate-transparency-go#1822

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.

2 participants