Skip to content
Cache bugs Disclosed report Intermediate

Public board pages are served Cache-Control: public with no Vary: Cookie, so a signed-in visitor's response is cached at the edge and returned to ev

Public board pages were served with a public cache header and no Vary: Cookie, so a signed-in visitor's response containing their user id, CSRF token, CSP nonce and timezone was cached at the edge and returned to unauthenticated requesters for 30 seconds. An attacker could obtain these session values by requesting the same public board URL shortly after a signed-in user visited it.

audion Follow

Originally disclosed on HackerOne

  • Triaged in 33 hours
  • Fixed in 14 days
  • Disclosed after 16 days

Summary

Public::BaseController marks public board pages Cache-Control: public, max-age=30. allow_unauthenticated_access skips only require_authentication, so resume_session still runs and a signed-in visitor receives a response carrying their own current-user-id, CSRF token, CSP nonce and timezone. Nothing sets Vary: Cookie, so the edge stores that response under the URL alone and serves it to every later requester for 30 seconds, cookies or not.

The CSP nonce is the part I would look at first. A nonce only does its job while it is unpredictable per response; one handed to every visitor for 30 seconds is not.

Steps to reproduce

The attached poc.sh runs the whole thing and prints its own verdict. It makes four requests over about twelve seconds and needs only curl and grep.

  1. On an account you own, create a board and turn on its Public link (Board → Edit → Public link).

  2. In a directory with poc.sh, create two files:

    • url.txt — one line, the public board URL: https://app.fizzy.do/<account>/public/boards/<key>
    • cookie.txt — one line, your whole Cookie header for app.fizzy.do (DevTools → Network → any request → Request Headers → Cookie)
  3. bash poc.sh

It uses two unrelated cache keys so each starts cold: a control key only ever requested without cookies, and a second key requested first while signed in and then twice with no cookies at all.

Output from my run

 CONTROL  - cache key never touched by a session
  cache-control max-age=30, public
  vary          Accept, Sec-Fetch-Site;accept-encoding
  cf-cache-status MISS
  bytes         41682
  user-id
  csp-nonce     7/Qk1HBUmy3mKMcyRm99nQ==
  csrf-token    101FIWl44AlIDYCUVKS1MpfQ
  timezone      UTC

 STEP 1   - same page, signed in, on a fresh cache key
  cf-cache-status MISS
  bytes         42024
  user-id       03h4k59urnaunl557zhxv8n9t
  csp-nonce     3VJ2MVY5bbTyYvoGH0q7wg==
  csrf-token    xFpYYrx1mjExo3DcFh_RRVcL
  timezone      Europe/London

 STEP 2   - same URL as step 1, NO cookies at all
  cf-cache-status HIT
  age           4
  bytes         42024
  user-id       03h4k59urnaunl557zhxv8n9t
  csp-nonce     3VJ2MVY5bbTyYvoGH0q7wg==
  csrf-token    xFpYYrx1mjExo3DcFh_RRVcL
  timezone      Europe/London

 STEP 3   - same URL again, still no cookies
  cf-cache-status HIT
  age           9
  bytes         42024
  user-id       03h4k59urnaunl557zhxv8n9t
  csp-nonce     3VJ2MVY5bbTyYvoGH0q7wg==
  csrf-token    xFpYYrx1mjExo3DcFh_RRVcL
  timezone      Europe/London

 RESULT
  control  (never signed in)   user-id: <absent>
  step 1   (signed in)         user-id: 03h4k59urnaunl557zhxv8n9t
  step 3   (no cookies)        user-id: 03h4k59urnaunl557zhxv8n9t

  REPRODUCED: the signed-in response was served to a cookieless request.
  Bodies are byte-identical.

and the diff the script prints between the control and the signed-in response:

<   <meta name="csp-nonce" content="7/Qk1HBUmy3mKMcyRm99nQ==" />
<   <meta name="timezone" content="UTC">
>   <meta name="csp-nonce" content="3VJ2MVY5bbTyYvoGH0q7wg==" />
>   <meta name="current-user-id" content="03h4k59urnaunl557zhxv8n9t">
>   <meta name="timezone" content="Europe/London">
>     [data-creator-id="03h4k59urnaunl557zhxv8n9t"] {
>     [data-creator-id]:not([data-creator-id="03h4k59urnaunl557zhxv8n9t"]) {

Three things read off that together:

  • vary lists Accept and Sec-Fetch-Site. Not Cookie.
  • Steps 2 and 3 are HIT with a rising age, byte-identical to step 1, and carry the same nonce, CSRF token, user id and timezone.
  • The control, on its own cache key, has no current-user-id, a different nonce and timezone: UTC. So the extra content in steps 2 and 3 came from the signed-in response, not from the page.

Impact

Impact

For 30 seconds after any signed-in person opens a public board link, anyone requesting that URL is served their response. From the output above, that hands over:

  • csp-nonce — shared across visitors for the cache window, so the nonce is no longer unpredictable while the entry lives. Any HTML injection reachable on that page would be scriptable against the policy for that window. I did not find such an injection and am not claiming one; what I am reporting is that the nonce stops being a per-response secret.
  • current-user-id — identifies which Fizzy user opened the board, and yields a real user id. It appears three times: once as a meta tag and twice in the user_css block.
  • timezone — the viewer's configured timezone.
  • csrf-token — a per-session value. It is bound to the session cookie, so it is not usable without that cookie; I list it as a session value that should not be shared between visitors, not as a CSRF path.
  • Anything in flash[:notice] or flash[:alert] for that session, which layouts/shared/_flash renders into the same page.

The board content itself is not the issue — it is published on purpose. What leaks is who looked at it and what their session was carrying.

The only precondition is that a signed-in person opens the public link, which is how these links are normally shared within a team.

Where it comes from

app/controllers/public/base_controller.rb

Ruby
class Public::BaseController < ApplicationController
  allow_unauthenticated_access      # skips require_authentication;
                                    # resume_session still runs
  before_action :set_public_cache_expiration

  private
    def set_public_cache_expiration
      expires_in 30.seconds, public: true
    end
end

app/views/layouts/public.html.erb renders layouts/shared/head — which emits csrf_meta_tags, csp_meta_tag, current-user-id, the timezone tag and layouts/shared/user_css — and layouts/shared/flash.

Suggested fix

Keep the cacheable response the one with nothing personal in it. Either render public pages without a session, or keep the session and stop marking those responses public:

Ruby
def set_public_cache_expiration
  if Current.identity
    expires_now
  else
    expires_in 30.seconds, public: true
  end
end

Vary: Cookie would also separate the entries, but at the cost of most of the caching, since nearly every visitor carries some cookie.

Notes

  • Tested only against a board and an account I created myself, registered with a @wearehackerone.com address. Both the signed-in and the cookieless requests in the script are mine; no other user's data was accessed at any point.
  • The board has been unpublished and the session signed out since.
  • I also checked whether this reaches the paid apps and did not find it there: world.hey.com/<user> does send Cache-Control: max-age=60, public, but Cloudflare answers cf-cache-status: DYNAMIC for it and the anonymous response carries no csrf-token, csp-nonce or user id. app.basecamp.com and launchpad.37signals.com both answer no-cache.

The original report as published on HackerOne, by audion. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The controller set a public cache expiration without varying the cache key by cookie, so responses containing session-specific data were cached and served to other users.

Impact

For 30 seconds after a signed-in user opens a public board link, anyone requesting that URL is served their response, leaking the user id, timezone, CSRF token and CSP nonce; the CSRF token is bound to the session cookie and not usable without it, and no HTML injection was found to exploit the nonce.

What the attacker needed

A signed-in user opens the public board link; attacker requests the same URL within 30 seconds

The fix

The response should not be marked public when a session is present; for example, expire immediately if an identity exists, or add Vary: Cookie (though that reduces caching).

How it was found

  1. Create a board and enable its public link.
  2. Prepare a file with the public board URL and a file with your Cookie header.
  3. Run the provided script, which makes a control request without cookies and then requests the same URL while signed in followed by cookieless requests.
  4. Observe that the cookieless requests receive the signed-in response with the same user id, CSRF token, CSP nonce and timezone.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a website tells a cache (like Cloudflare) that a page can be stored and reused, it must also tell the cache to keep separate copies for different users. Here, the page was marked public but the cache was not told to vary by cookie, so the version created for a logged-in user was stored and then shown to anyone else who asked for the same URL. This leaked the logged-in user's ID, a security token, and other personal details.

What is Cache bugs?

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.

More by audion

View all

1 more disclosed report, best first.

More from Basecamp

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Web cache poisoning and deception

The lesson behind this report.

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.