Race Condition Affecting rack-session package, versions >=2.0.0, <2.1.1


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.02% (5th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Race Condition vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUBY-RACKSESSION-10074669
  • published8 May 2025
  • disclosed7 May 2025
  • creditS. Tokarenko

Introduced: 7 May 2025

NewCVE-2025-46336  (opens in a new tab)
CWE-362  (opens in a new tab)

How to fix?

Upgrade rack-session to version 2.1.1 or higher.

Overview

rack-session is a session implementation for Rack.

Affected versions of this package are vulnerable to Race Condition in Rack::Session::Pool middleware, which allows an attacker to restore and use a deleted session. The attacker must be in possession of a valid session cookie and the attack must be timed to coincide with a disconnection from the long-running session by another user.

Workaround

This vulnerability can be avoided by invalidating sessions using the logged_out flag rather than deleting them, or by enforcing session invalidation by maintaining a custom session store and invalidating based on timestamp as soon as a session is closed.

References

CVSS Base Scores

version 4.0
version 3.1