google / google/certificate-transparency-go

Certificate parser accepts signatures with non-whole number of bytes

Open
#1,817 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
1.2k
Forks
322
Avg merge
3d 4h
Merged PRs (30d)
5

Description

The certificate parser accepts signatures (which regrettably use BIT STRING instead of OCTET STRING) with non-whole number of bytes, right-aligning them as necessary:

https://github.com/google/certificate-transparency-go/blob/7bd73e412c9547568cb3351cbbc74d009e1da2d5/x509/x509.go#L1842

This is unnecessary as RSA and ECDSA signatures always have a whole number of bytes, and introduces a spam vector through signature malleability - an RSA certificate can be logged 1-7 times, and an ECDSA certificate can be logged 3 times (not counting the existing point negation trick).

The upstream Go issue is https://github.com/golang/go/issues/81178 (credit to @davidben).

Contributor guide

Open the contributing guide

Research direction

Read x509/x509.go around line 1842 and compare the parser behavior with the linked upstream Go issue. Confirm how RSA and ECDSA signatures with non-whole byte lengths are handled, then add coverage for the reported cases and verify that valid whole-byte signatures remain accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cryptography, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.