CVE-2025-32441
Medium · 4.2Rack session gets restored after deletion
CVSS
4.2
EPSS
0.2%
Published
May 8, 2025
CISA due date
—
Cloudanix analysis
A flaw in a common web application component could allow an attacker to take over another person's session by sending precisely timed requests, potentially giving them access to that person's information.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Moderate
- Impact
- Privilege Gain
- Component
- Library
- Class
- Race Condition
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
A race condition vulnerability exists in the `Rack::Session::Pool` middleware. When handling simultaneous requests, it is possible for a session that has been marked for deletion to be restored and reused by a new, unauthenticated request. This can lead to session fixation or session hijacking, where an attacker can occupy a previously valid session identifier, potentially inheriting session data or state if the application logic is not robust.
Why it matters to the business
This vulnerability could allow an attacker to take over another user's session, potentially leading to unauthorized access to sensitive information or the ability to perform actions on behalf of the victim. This can result in data breaches, loss of user privacy, and erosion of trust in the application. The exploitability is complex, requiring precise timing, which lowers the immediate risk, but a successful attack could have a significant impact on individual user accounts.
How an attack unfolds
An attacker would first identify an application using the vulnerable `Rack::Session::Pool` middleware. The attacker would then need to orchestrate the sending of at least two simultaneous requests to the target application. One request would trigger the deletion of a session (e.g., by hitting a logout endpoint), while the other, timed to arrive at the exact same moment, would initiate a new session. Due to the race condition, the new session request could successfully restore and occupy the session ID that was in the process of being deleted, effectively hijacking it.
How to fix it
Update the `rack` gem to a version that includes the fix from commit `d0dcf75706d72d7e874ee31934a97881c1a439ce`. Developers should review their project's dependencies and update to the latest secure version of Rack. As a temporary mitigation if patching is not immediately possible, consider switching from `Rack::Session::Pool` to an alternative session store (e.g., `Rack::Session::Cookie` or a database-backed store) that provides stronger atomicity guarantees for session operations.
How to confirm the fix worked
To confirm remediation, check the installed version of the `rack` gem in your application's environment to ensure it incorporates the security patch. You can use your package manager (e.g., `bundle show rack`) to verify the version. Automated dependency scanning tools can also be used to flag vulnerable versions. While difficult to test reliably, penetration testing could attempt to reproduce the race condition against a test environment to confirm the fix.
Typical attack path
- Identify a target application using the vulnerable `Rack::Session::Pool` middleware.
- Craft two concurrent requests: one to trigger a session deletion and another to initiate a new session.
- Send the requests simultaneously to the server to trigger the race condition.
- If successful, the attacker's request re-uses the just-deleted session ID.
- The attacker now controls a session that may contain stale data or have unintended associations from its previous owner.
How to detect it
Detecting exploitation of this race condition is challenging as it relies on observing behavior rather than static signatures. Monitor web server and application logs for an unusually high rate of concurrent requests from a single source IP, particularly targeting session creation and deletion endpoints. Analyze session lifecycle events for anomalies, such as a session ID being destroyed and then immediately reused by a request with a different user agent or from a different IP address.
What your security team should do
- Immediately identify all Ruby applications using the `Rack::Session::Pool` middleware and prioritize them for patching.
- Update the `rack` gem to a patched version in all affected applications.
- If patching is delayed, advise development teams to switch to a more robust session management backend as a compensating control.
The record
When using the `Rack::Session::Pool` middleware, simultaneous rack requests can restore a deleted rack session, which allows the unauthenticated user to occupy that session.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| RubyGems | rack | 0 | 2.2.14 |
| Chainguard | gitlab-rails-ce-18.1 | 0 | 18.1.6-r3 |
| Chainguard | gitlab-rails-ce-assets-18.1 | 0 | 18.1.6-r1 |
| Chainguard | gitlab-rails-ce-assets-fips-18.1 | 0 | 18.1.6-r2 |
| Chainguard | gitlab-rails-ce-doc-18.1 | 0 | 18.1.6-r1 |
| Chainguard | gitlab-rails-ce-doc-fips-18.1 | 0 | 18.1.6-r2 |
| Chainguard | gitlab-rails-ce-fips-18.1 | 0 | 18.1.6-r4 |
| Chainguard | ruby3.3-rack-2.2 | 0 | 2.2.22-r0 |
| Debian:11 | ruby-rack | 0 | No fix |
| Debian:12 | ruby-rack | 0 | No fix |
| Debian:13 | ruby-rack | 0 | 3.0.8-2 |
| SUSE:Linux Enterprise High Availability Extension 15 SP3 | rubygem-rack | 0 | 2.0.8-150000.3.31.1 |
| SUSE:Linux Enterprise High Availability Extension 15 SP4 | rubygem-rack | 0 | 2.0.8-150000.3.31.1 |
| SUSE:Linux Enterprise High Availability Extension 15 SP5 | rubygem-rack | 0 | 2.0.8-150000.3.31.1 |
| SUSE:Linux Enterprise High Availability Extension 15 SP6 | rubygem-rack | 0 | 2.0.8-150000.3.31.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | rmt-server | 0 | 2.23-150400.3.42.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | rmt-server | 0 | 2.23-150400.3.42.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | rmt-server | 0 | 2.23-150500.3.34.2 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | rmt-server | 0 | 2.23-150500.3.34.2 |
| SUSE:Linux Enterprise Module for Public Cloud 15 SP4 | rmt-server | 0 | 2.23-150400.3.42.1 |
| SUSE:Linux Enterprise Module for Public Cloud 15 SP5 | rmt-server | 0 | 2.23-150500.3.34.2 |
| SUSE:Linux Enterprise Module for Public Cloud 15 SP6 | rmt-server | 0 | 2.23-150500.3.34.2 |
| SUSE:Linux Enterprise Module for Public Cloud 15 SP7 | rmt-server | 0 | 2.23-150700.3.6.1 |
| SUSE:Linux Enterprise Module for Server Applications 15 SP6 | rmt-server | 0 | 2.23-150500.3.34.2 |
| SUSE:Linux Enterprise Module for Server Applications 15 SP7 | rmt-server | 0 | 2.23-150700.3.6.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | rmt-server | 0 | 2.23-150400.3.42.1 |
| SUSE:Linux Enterprise Server 15 SP5-LTSS | rmt-server | 0 | 2.23-150500.3.34.2 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | rmt-server | 0 | 2.23-150400.3.42.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | rmt-server | 0 | 2.23-150500.3.34.2 |
| SUSE:Manager Proxy 4.3 | rmt-server | 0 | 2.23-150400.3.42.1 |
| SUSE:Manager Server 4.3 | rmt-server | 0 | 2.23-150400.3.42.1 |
| Wolfi | ruby3.3-rack-2.2 | 0 | 2.2.22-r0 |
| openSUSE:Leap 15.6 | rmt-server | 0 | 2.23-150500.3.34.2 |
| openSUSE:Leap 15.6 | rubygem-rack | 0 | 2.0.8-150000.3.31.1 |
Related vulnerabilities
- CVE-2026-25500 Rack is a modular Ruby web server interface. Also affects rack
- CVE-2026-22860 Rack is a modular Ruby web server interface. Also affects rack
- CVE-2025-61919 Rack is vulnerable to a memory-exhaustion DoS through unbounded URL-encoded body parsing Also affects rack
- CVE-2025-61780 Rack has a Possible Information Disclosure Vulnerability Also affects rack
- CVE-2025-61770 Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion) Also affects rack
- CVE-2025-61771 Rack: Multipart parser buffers large non‑file fields entirely in memory, enabling DoS… Also affects rack
- CVE-2025-61772 Rack's multipart parser buffers unbounded per-part headers, enabling DoS (memory… Also affects rack
- CVE-2025-59830 Rack has an unsafe default in Rack::QueryParser allows params_limit bypass via… Also affects rack