Miggo Logo

CVE-2025-32441:
Rack session gets restored after deletion

4.2

CVSS Score
3.1

Basic Information

EPSS Score
0.08498%
Published
5/8/2025
Updated
5/9/2025
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
rackrubygems<= 2.2.132.2.14

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability describes a race condition where a deleted Rack session can be restored by simultaneous requests when using Rack::Session::Pool. The commit c48e52f7c57e99e1e1bf54c8760d4f082cd1c89d addresses this issue by modifying two functions in lib/rack/session/pool.rb: write_session and delete_session.

The core of the vulnerability lies in the ability to restore a session after it has been deleted. This restoration happens when session data is written back to the store. The write_session function is responsible for this action. The patch introduces a crucial check (return false unless get_session_with_fallback(session_id)) in write_session before it attempts to store the session data. The absence of this check in the vulnerable version allowed a concurrent request (that had loaded session data before its deletion) to write this data back, effectively 'restoring' the deleted session. The commit message directly confirms that the change to write_session is to prevent it from succeeding if the session doesn't exist, fixing the concurrent deletion issue.

The delete_session function was also modified to ensure that when a new session ID is generated after a deletion (if options[:drop] is false), an empty session is immediately stored for this new ID. This is a hardening measure to prevent the old, deleted session data from being associated with a potentially reused SID. However, the actual act of 'restoring' the session, which is the crux of the vulnerability, occurs within write_session due to the missing check.

Therefore, Rack::Session::Pool#write_session is identified as the vulnerable function because its previous implementation allowed the restoration of a deleted session under race conditions.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry W**n usin* t** `R**k::S*ssion::Pool` mi**l*w*r*, simult*n*ous r**k r*qu*sts **n r*stor* * **l*t** r**k s*ssion, w*i** *llows t** un*ut**nti**t** us*r to o**upy t**t s*ssion. ### **t*ils [R**k s*ssion mi**l*w*r*](*ttps://*it*u*.*om/r**k

Reasoning

T** vuln*r**ility **s*ri**s * r*** *on*ition w**r* * **l*t** R**k s*ssion **n ** r*stor** *y simult*n*ous r*qu*sts w**n usin* `R**k::S*ssion::Pool`. T** *ommit `****************************************` ***r*ss*s t*is issu* *y mo*i*yin* two *un*tions