# CVE-2025-46336: Rack session gets restored after deletion

> Attackers can retain illicit access after user logout via a race condition in Rack session pool, requiring a long-running request and stolen cookie.

- **Severity:** Medium 4.2 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 May 2025
- **Updated:** 8 May 2025
- **Also known as:** DEBIAN-CVE-2025-46336, GHSA-9j94-67jr-4cqj, UBUNTU-CVE-2025-46336, openSUSE-SU-2025:15623-1, openSUSE-SU-2026:10359-1

## What is CVE-2025-46336?

CVE-2025-46336 is a medium-severity vulnerability in rack-session, published on 8 May 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Rack::Session is a session management implementation for Rack. In versions starting from 2.0.0 to before 2.1.1, when using the Rack::Session::Pool middleware, and provided the attacker can acquire a session cookie (already a major issue), the session may be restored if the attacker can trigger a long running request (within that same session) adjacent to the user logging out, in order to retain illicit access even after a user has attempted to logout. This issue has been patched in version 2.1.1.

Weakness: CWE-613 (DEPRECATED: Insufficient Session Expiration), CWE-367 (Time-of-check Time-of-use (TOCTOU) Race Condition), CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

## Which versions are affected by CVE-2025-46336?

2 open source packages ship an affected version, including rack-session.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rack-session` | RubyGems | From 2.0.0 | 2.1.1 |
| `rack-session` | RubyGems | From 2.0.0 | 2.1.1 |
| `rubygem-rack-session` | openSUSE:Tumbleweed | All versions | 2.1.1-1.1 |
| `rubygem-rack-session` | openSUSE:Tumbleweed | All versions | 2.1.1-1.3 |

## How do I fix CVE-2025-46336?

Upgrade rack-session to 2.1.1 or later.

## Is CVE-2025-46336 being exploited?

There is no known exploitation of CVE-2025-46336 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-46336 and fix it if it is affected.

What it is: CVE-2025-46336 is a medium-severity vulnerability in rack-session, published on 8 May 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-46336 in the wild and no public exploit code.

Affected packages and fixed versions:
- rack-session (RubyGems): affected from 2.0.0; fixed in 2.1.1
- rack-session (RubyGems): affected from 2.0.0; fixed in 2.1.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-46336/ (Markdown: https://insights.sbomify.com/CVE-2025-46336/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-46336
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-46336
- OSV: https://osv.dev/vulnerability/CVE-2025-46336

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-46336/
Summaries are generated and may contain mistakes; the official description above is the record.
