cloudflare / cloudflare/tls-tris
Wrong alert sent by client in case server sends unexpected protocol version in SH.
- Dominant language
- Go
- Stars
- 300
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
As per 4.2.1 of TLS 1.3, client needs to verify that TLS version sent by server in the ServerHello is one of those advertised by client.
This is done in:
```
clientHandshakeState::handshake()
-> pickTLSVersion()
```
Nevertheless, if server sends unexpected version number client aborts the connection with ``alertProtocolVersion``.
The spec for TLS 1.3 says that client should abort with ``alertIllegalParameter(47)``. Which is a bug.
Fixing the problem causes regression in bogo tests, code is not specific to protocol version being negotiated and TLS 1.2 doesn't explicitly specify which alert should be sent in similar case.
Contributor guide
Research direction
Start in clientHandshakeState::handshake() and follow pickTLSVersion(), as identified in the issue. Read TLS 1.3 section 4.2.1 and run the relevant bogo tests to understand the regression and the existing TLS 1.2 behavior. Done means the unexpected ServerHello version produces the specified alert without breaking applicable tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100