Executive brief
A vulnerability in the Rack session management library allows attackers to bypass security protections on web session cookies. By sending a specially crafted cookie that fails decryption, an attacker can force the system to accept unencrypted, forged session data. This could allow an unauthorized person to hijack user accounts or escalate their privileges within an affected web application.
Technical details
The vulnerability exists in Rack::Session::Cookie when configured with the 'secrets:' option. When an incoming cookie fails decryption, the implementation incorrectly falls back to a default decoder instead of rejecting the request. An unauthenticated attacker can exploit this by providing a crafted, unencrypted cookie that the fallback mechanism processes as trusted session state. This bypasses integrity protections and can lead to session forgery, authentication bypass, or arbitrary object deserialization if the application uses vulnerable serializers like Marshal. The issue is fixed in version 2.1.2.
Affected products
- Rack rack-session >= 2.0.0, < 2.1.2
Timeline
- 2026-04-07: disclosed
- 2026-04-08: advisory
- 2026-04-07: patched: Patched in version 2.1.2