<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/ghsa-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy" -->

---
title: GHSA-vvhm-j6m8-64cw (rack-protection): rack-protection -...
description: The rack-protection gem's JsonCsrf, RemoteToken and RemoteReferrer checks can be bypassed when a request has no Referer header. With the default...
canonical: https://daily.dev/posts/ghsa-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: GHSA-vvhm-j6m8-64cw (rack-protection): rack-protection - a missing Referer is treated as same-origin, allowing a bypass of JsonCsrf, RemoteToken and RemoteReferrer | daily.dev
og:description: The rack-protection gem's JsonCsrf, RemoteToken and RemoteReferrer checks can be bypassed when a request has no Referer header. With the default...
og:url: https://daily.dev/posts/ghsa-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy
og:image: https://api.daily.dev/og/posts/UhEw1phXy.png
og:image:alt: GHSA-vvhm-j6m8-64cw (rack-protection): rack-protection - a missing Referer is treated as same-origin, allowing a bypass of JsonCsrf, RemoteToken and RemoteReferrer
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-vvhm-j6m8-64cw (rack-protection): rack-protection - a missing Referer is treated as same-origin, allowing a bypass of JsonCsrf, RemoteToken and RemoteReferrer

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

## Summary

The rack-protection gem's JsonCsrf, RemoteToken and RemoteReferrer checks can be bypassed when a request has no Referer header. With the default allow_empty_referrer: true, a missing Referer was treated as same-origin. A cross-site page can suppress the header using <meta name="referrer" content="no-referrer">, slipping past these CSRF protections. The CVSS score is 3.1 (low). HttpOrigin and XSSHeader, both enabled by default in Sinatra, limit the impact. The issue is patched in rack-protection 4.2.2.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://rubysec.com/advisories/GHSA-vvhm-j6m8-64cw>

## Questions this post answers

### How can a missing Referer header bypass CSRF protection in rack-protection?

Rack::Protection::JsonCsrf, RemoteToken and RemoteReferrer compare the Referer header's host to the request host to detect cross-site requests. With the default allow_empty_referrer: true, a request with no Referer header was treated as same-origin. An attacker page can suppress the header with a meta referrer policy of 'no-referrer', bypassing these checks. The fix ships in rack-protection 4.2.2.

_Teams patching CSRF middleware can track advisories like this one on daily.dev._

### Does this rack-protection Referer bypass actually put Sinatra apps at risk?

The real-world impact is limited, rated CVSS 3.1 (low). Sinatra enables Rack::Protection::HttpOrigin by default, which still rejects cross-site unsafe requests whenever the browser sends an Origin header, something current browsers do for cross-site form posts even with a suppressed referrer. XSSHeader's nosniff header also stops JSON responses from being read as scripts.

_Developers weighing how urgently to patch a low-severity CVE can check context like this on daily.dev._

## Similar posts on daily.dev

- [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
- [GHSA-pf75-2v58-7mxg \(rack-protection\): rack-protection - one request makes CookieTossing reject, or drop the session of, every later request](https://daily.dev/posts/ghsa-pf75-2v58-7mxg-rack-protection-rack-protection---one-request-makes-cookietossing-reject-or--fcw0kid3g) · RUBYLAND · 0 upvotes · 0 comments
- [CSRF Protection without Tokens or Hidden Form Fields](https://daily.dev/posts/csrf-protection-without-tokens-or-hidden-form-fields-a651bvhew) · Hacker News · 0 upvotes · 0 comments
- [GHSA-prq8-7wvh-44qh \(oauth\): Cross-origin OAuth token-request redirects can expose signed request metadata](https://daily.dev/posts/ghsa-prq8-7wvh-44qh-oauth-cross-origin-oauth-token-request-redirects-can-expose-signed-request-me-ktjgrr4kt) · RUBYLAND · 0 upvotes · 0 comments
- [GitHub - scoville/req\_ssrf: SSRF protection for Req](https://daily.dev/posts/github---scoville-req-ssrf-ssrf-protection-for-req-4awzo12ju) · ElixirStatus · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#ruby](https://daily.dev/tags/ruby), [#web-security](https://daily.dev/tags/web-security), [#sinatra](https://daily.dev/tags/sinatra)

[View this post on daily.dev](https://daily.dev/posts/ghsa-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy)

```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-vvhm-j6m8-64cw (rack-protection): rack-protection - a missing Referer is treated as same-origin, allowing a bypass of JsonCsrf, RemoteToken and RemoteReferrer","url":"https://daily.dev/posts/ghsa-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/ghsa-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy"},"datePublished":"2026-11-22T15:22:37.418Z","dateModified":"2026-11-22T15:23:04.297Z","description":"The rack-protection gem's JsonCsrf, RemoteToken and RemoteReferrer checks can be bypassed when a request has no Referer header. With the default...","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-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,ruby,web-security,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-vvhm-j6m8-64cw (rack-protection): rack-protection - a missing Referer is treated as same-origin, allowing a bypass of JsonCsrf, RemoteToken and RemoteReferrer"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/ghsa-vvhm-j6m8-64cw-rack-protection-rack-protection---a-missing-referer-is-treated-as-same-origin-uhew1phxy#faq","mainEntity":[{"@type":"Question","name":"How can a missing Referer header bypass CSRF protection in rack-protection?","acceptedAnswer":{"@type":"Answer","text":"Rack::Protection::JsonCsrf, RemoteToken and RemoteReferrer compare the Referer header's host to the request host to detect cross-site requests. With the default allow_empty_referrer: true, a request with no Referer header was treated as same-origin. An attacker page can suppress the header with a meta referrer policy of 'no-referrer', bypassing these checks. The fix ships in rack-protection 4.2.2. Teams patching CSRF middleware can track advisories like this one on daily.dev."}},{"@type":"Question","name":"Does this rack-protection Referer bypass actually put Sinatra apps at risk?","acceptedAnswer":{"@type":"Answer","text":"The real-world impact is limited, rated CVSS 3.1 (low). Sinatra enables Rack::Protection::HttpOrigin by default, which still rejects cross-site unsafe requests whenever the browser sends an Origin header, something current browsers do for cross-site form posts even with a suppressed referrer. XSSHeader's nosniff header also stops JSON responses from being read as scripts. Developers weighing how urgently to patch a low-severity CVE can check context like this on daily.dev."}}]}
```

