rack-protection - one request makes CookieTossing reject, or drop the session of, every later request
Published: November 17, 2026
SECURITY IDENTIFIERS
- GHSA: GHSA-pf75-2v58-7mxg
- Vendor Advisory: https://github.com/sinatra/sinatra/security/advisories/GHSA-pf75-2v58-7mxg
GEM
SEVERITY
CVSS v3.x: 7.5 (High)
UNAFFECTED VERSIONS
< 2.0.0
PATCHED VERSIONS
>= 4.2.2
DESCRIPTION
Summary
Rack::Protection::CookieTossing kept the list of bad cookies it found on the middleware instance, which serves every request of the application, and never cleared it. After a single request with a duplicated session cookie, the middleware treated every later request, from every client, as a cookie tossing attack, until the process was restarted.
Only applications that have enabled the middleware are affected. It is not part of the default Rack::Protection stack and Sinatra does not enable it.
Impact
Denial of service, by anyone who can send a request to the application, with a single request. What happens to the later requests depends on the reaction the middleware is configured with:
-
With reaction: :deny, the default of the middleware when used on its own, every request is answered with 403 Forbidden.
-
With reaction: :drop_session, the default when enabled through Sinatra's set :protection, use: :cookie_tossing, the session of every request is cleared, so nobody can stay logged in.
In addition, every later response carries Set-Cookie headers that expire the collected cookie names, one per name and path segment, so repeated requests make all responses grow.
The application recovers only when its processes are restarted. No data is exposed.
