google / google/certificate-transparency-go

runtime error: slice bounds out of range

Open
#941 5 comments 0 reactions 0 assignees View on GitHub
bug x509
Dominant language
Go
Stars
1.2k
Forks
322
Avg merge
3d 4h
Merged PRs (30d)
5

Description

Hello,

Sometimes unexpectedly get the following error

```
panic: runtime error: slice bounds out of range [:1378] with capacity 1315

github.com/google/certificate-transparency-go/asn1.parseField({0x9a98e0?, 0xc004b1b800?, 0xb?}, {0xc0119ec100, 0x562, 0x523}, 0x0, {0x0, 0x0, 0x0, ...})
#011/root/go/pkg/mod/github.com/google/certificate-transparency-go@v1.1.3/asn1/asn1.go:940 +0x31de
github.com/google/certificate-transparency-go/asn1.UnmarshalWithParams({0xc0119ec100, 0x562, 0x523}, {0x937a20?, 0xc004b1b800?}, {0x0, 0x0})
#011/root/go/pkg/mod/github.com/google/certificate-transparency-go@v1.1.3/asn1/asn1.go:1190 +0x1b7
github.com/google/certificate-transparency-go/asn1.Unmarshal(...)
#011/root/go/pkg/mod/github.com/google/certificate-transparency-go@v1.1.3/asn1/asn1.go:1183
github.com/google/certificate-transparency-go/x509.ParseCertificate({0xc0119ec100, 0x562, 0x523})
#011/root/go/pkg/mod/github.com/google/certificate-transparency-go@v1.1.3/x509/x509.go:2116 +0x95
```

Contributor guide

Open the contributing guide

Research direction

Start at asn1/asn1.go:940, where the slice-bounds panic occurs, and trace the call from x509/x509.go:2116 through ParseCertificate. Use the reported certificate input or obtain a reproducible case, then verify that malformed or unexpected data no longer causes this panic and that certificate parsing still behaves correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.