Undefined behaviour in ssl_session_calculate_timeout() in 3.1/3.0
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 30.8k
- Forks
- 11.5k
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
The function ssl_session_calculate_timeout adds a time to a timeout value but does not check for possible overflow in 3.1/3.0. Therefore setting a very large timeout value using SSL_SESSION_set_timeout can cause undefined behaviour.
This is not the case in 3.2/3.3/master where we do the addition safely.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating ssl_session_calculate_timeout() in the OpenSSL 3.1 or 3.0 branch and compare its timeout addition with the safe implementation in 3.2, 3.3, or master. Reproduce the case using a very large value passed to SSL_SESSION_set_timeout, then verify that the older branches handle the addition without undefined behaviour.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cryptography, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100