openssl / openssl/openssl

Undefined behaviour in ssl_session_calculate_timeout() in 3.1/3.0

Open
#24,046 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

branch: 3.0 triaged: bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.