<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g" -->

---
title: GHSA-pf75-2v58-7mxg (rack-protection): rack-protection -...
description: A single request can make rack-protection's CookieTossing middleware treat every later request as an attack. The middleware stores detected bad cookies on the...
canonical: https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: GHSA-pf75-2v58-7mxg (rack-protection): rack-protection - one request makes CookieTossing reject, or drop the session of, every later request | daily.dev
og:description: A single request can make rack-protection's CookieTossing middleware treat every later request as an attack. The middleware stores detected bad cookies on the...
og:url: https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g
og:image: https://api.daily.dev/og/posts/Fcw0kID3G.png
og:image:alt: GHSA-pf75-2v58-7mxg (rack-protection): rack-protection - one request makes CookieTossing reject, or drop the session of, every later request
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GHSA-pf75-2v58-7mxg (rack-protection): rack-protection - one request makes CookieTossing reject, or drop the session of, every later request

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 2 min read · 0 upvotes · 0 comments

## Summary

A single request can make rack-protection's CookieTossing middleware treat every later request as an attack. The middleware stores detected bad cookies on the shared middleware instance and never clears the list, so one request with a duplicated session cookie affects every client. With reaction: :deny, every request is answered with 403 Forbidden. With :drop_session, used by Sinatra's set :protection, use: :cookie_tossing, the session of every request is cleared, so nobody can stay logged in. Responses also grow as expired Set-Cookie headers accumulate. The bug is rated CVSS 7.5 (High) and is patched in 4.2.2. The application recovers only when its processes are restarted. No data is exposed.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://rubysec.com/advisories/GHSA-pf75-2v58-7mxg>

## Questions this post answers

### What is GHSA-pf75-2v58-7mxg in rack-protection and how does it cause a denial of service?

It's a vulnerability where Rack::Protection::CookieTossing stores detected bad cookies on the shared middleware instance and never clears them. A single request with a duplicated session cookie makes the middleware treat all subsequent requests, from any client, as cookie tossing attacks until the process restarts. It's rated CVSS 7.5 (High) and fixed in version 4.2.2.

_Teams running rack-protection track CVE fixes like this one through daily.dev to patch before an outage hits._

### What happens to user sessions when the rack-protection CookieTossing bug is triggered with drop_session reaction?

Every request's session gets cleared, meaning no user can stay logged in until the application process is restarted. This is the default reaction when CookieTossing is enabled via Sinatra's set :protection, use: :cookie_tossing. The alternative :deny reaction instead returns 403 Forbidden to every request. No data is exposed in either case.

_Sinatra developers weighing protection settings follow advisories like this on daily.dev before enabling session middleware._

### Which versions of rack-protection fix the CookieTossing denial of service vulnerability?

The fix lands in version 4.2.2 and later; versions before 2.0.0 are unaffected since the vulnerable code was introduced later. Applications must have explicitly enabled the CookieTossing middleware to be at risk, since it is not part of the default Rack::Protection stack and Sinatra doesn't enable it by default.

_Developers auditing Ruby gem dependencies for known CVEs keep track of patch versions like this via daily.dev._

## Similar posts on daily.dev

- [GHSA-vvhm-j6m8-64cw \(rack-protection\): rack-protection - a missing Referer is treated as same-origin, allowing a bypass of JsonCsrf, RemoteToken and RemoteReferrer](https://daily.dev/posts/ghsa-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy) · RUBYLAND · 0 upvotes · 0 comments
- [GHSA-x6mj-8jx9-qhqv \(actionpack\): Possible sensitive session information leak in Active Storage proxy mode](https://daily.dev/posts/ghsa-x6mj-8jx9-qhqv-actionpack-possible-sensitive-session-information-leak-in-active-storage-prox-yivunawnn) · RUBYLAND · 0 upvotes · 0 comments
- [Rails’ Default Authentication Has a Database Restore Problem](https://daily.dev/posts/rails-default-authentication-has-a-database-restore-problem-bpqcdzlde) · Ruby Flow · 0 upvotes · 0 comments
- [GHSA-r29j-38x9-qr26 \(rack-protection\): rack-protection - HostAuthorization permits unrelated hosts that end with a leading-dot permitted host](https://daily.dev/posts/ghsa-r29j-38x9-qr26-rack-protection-rack-protection---hostauthorization-permits-unrelated-hosts-t-92yesdio2) · RUBYLAND · 0 upvotes · 0 comments
- [Securing Rails](https://daily.dev/posts/securing-rails-sybjpaec6) · This Week in Rails · 0 upvotes · 0 comments

---

Tags: [#cyber](https://daily.dev/tags/cyber), [#authentication](https://daily.dev/tags/authentication), [#ruby](https://daily.dev/tags/ruby), [#sinatra](https://daily.dev/tags/sinatra)

[View this post on daily.dev](https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"GHSA-pf75-2v58-7mxg (rack-protection): rack-protection - one request makes CookieTossing reject, or drop the session of, every later request","url":"https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g"},"datePublished":"2026-11-22T15:22:37.438Z","dateModified":"2026-11-22T15:23:07.487Z","description":"A single request can make rack-protection's CookieTossing middleware treat every later request as an attack. The middleware stores detected bad cookies on the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5fa7bf38a8a9c178c1d458f9f735556c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5fa7bf38a8a9c178c1d458f9f735556c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cyber,authentication,ruby,sinatra","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"GHSA-pf75-2v58-7mxg (rack-protection): rack-protection - one request makes CookieTossing reject, or drop the session of, every later request"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g#faq","mainEntity":[{"@type":"Question","name":"What is GHSA-pf75-2v58-7mxg in rack-protection and how does it cause a denial of service?","acceptedAnswer":{"@type":"Answer","text":"It's a vulnerability where Rack::Protection::CookieTossing stores detected bad cookies on the shared middleware instance and never clears them. A single request with a duplicated session cookie makes the middleware treat all subsequent requests, from any client, as cookie tossing attacks until the process restarts. It's rated CVSS 7.5 (High) and fixed in version 4.2.2. Teams running rack-protection track CVE fixes like this one through daily.dev to patch before an outage hits."}},{"@type":"Question","name":"What happens to user sessions when the rack-protection CookieTossing bug is triggered with drop_session reaction?","acceptedAnswer":{"@type":"Answer","text":"Every request's session gets cleared, meaning no user can stay logged in until the application process is restarted. This is the default reaction when CookieTossing is enabled via Sinatra's set :protection, use: :cookie_tossing. The alternative :deny reaction instead returns 403 Forbidden to every request. No data is exposed in either case. Sinatra developers weighing protection settings follow advisories like this on daily.dev before enabling session middleware."}},{"@type":"Question","name":"Which versions of rack-protection fix the CookieTossing denial of service vulnerability?","acceptedAnswer":{"@type":"Answer","text":"The fix lands in version 4.2.2 and later; versions before 2.0.0 are unaffected since the vulnerable code was introduced later. Applications must have explicitly enabled the CookieTossing middleware to be at risk, since it is not part of the default Rack::Protection stack and Sinatra doesn't enable it by default. Developers auditing Ruby gem dependencies for known CVEs keep track of patch versions like this via daily.dev."}}]}
```

