{"id":"CVE-2025-46336","aliases":["CVE-2025-46336","GHSA-9j94-67jr-4cqj"],"related":[],"kind":"vulnerability","state":"published","title":"Rack session gets restored after deletion","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nWhen using the `Rack::Session::Pool` middleware, simultaneous rack requests can restore a deleted rack session, which allows the unauthenticated user to occupy that session.\n\n## Details\n\n[Rack session middleware](https://github.com/rack/rack-session/blob/v2.1.0/lib/rack/session/abstract/id.rb#L271-L278) prepares the session at the beginning of request, then saves is back to the store with possible changes applied by host rack application. This way the session becomes to be a subject of race conditions in general sense over concurrent rack requests.\n\n## Impact\n\nWhen 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.\n\n## Mitigation\n\n- Update to the latest version of `rack-session`, or\n- Ensure your application invalidates sessions atomically by marking them as logged out e.g., using a `logged_out` flag, instead of deleting them, and check this flag on every request to prevent reuse, or\n- Implement a custom session store that tracks session invalidation timestamps and refuses to accept session data if the session was invalidated after the request began.\n\n## Related\n\nThis code was previously part of `rack` in Rack < 3, see <https://github.com/rack/rack/security/advisories/GHSA-vpfw-47h7-xj4g> for the equivalent advisory in `rack` (affecting Rack < 3 only).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Rack::Session es una implementación de gestión de sesiones para Rack. En versiones desde la 2.0.0 hasta anteriores a la 2.1.1, al usar el middleware Rack::Session::Pool, y siempre que el atacante pueda obtener una cookie de sesión (un problema ya grave), la sesión puede restaurarse si el atacante activa una solicitud de larga duración (dentro de la misma sesión) junto al cierre de sesión del usuario, para así conservar el acceso ilícito incluso después de que el usuario haya intentado cerrar sesión. Este problema se ha corregido en la versión 2.1.1.","source":"nvd"}],"published":"2025-05-08T14:45:33.000Z","modified":"2026-09-10T03:50:57.454Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N","score":4.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N","score":4.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N","score":4.2,"rating":"MEDIUM"}],"cwes":["CWE-362","CWE-367","CWE-613"],"affected":[{"ranges":[{"version":">= 2.0.0, < 2.1.1","status":"affected"}],"vendor":"rack","product":"rack-session","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.1.1"}],"ecosystem":"RubyGems","package":"rack-session","purl":"pkg:gem/rack-session","source":"ghsa"}],"references":[{"url":"https://github.com/rack/rack-session/security/advisories/GHSA-9j94-67jr-4cqj","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-vpfw-47h7-xj4g","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rack/rack-session/commit/c28c4a8c1861d814e09f2ae48264ac4c40be2d3b","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46336","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rack/rack-session","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack-session/CVE-2025-46336.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-05-08T20:18:09.543Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-46336","url":"https://www.cve.org/CVERecord?id=CVE-2025-46336","licence":"CVE Terms of Use","modified":"2025-05-08T20:18:38.555Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9j94-67jr-4cqj","url":"https://github.com/advisories/GHSA-9j94-67jr-4cqj","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:57.454Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-46336","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46336","licence":"Public domain","modified":"2026-06-17T09:26:15.517Z"}],"updatedAt":"2026-11-25T22:58:57.821Z","epss":{"score":0.00394,"percentile":0.25218,"date":"2026-11-30T12:00:22.000Z"}}