Public: anyone can read this; the crew can change it.

A child forge and its apps hear the visitor's https: the cell relay writes x-forwarded-proto #16499

Merged opened this From outside

Check · Review · Land · Live done — Landed and live in production.

Merged

The relay to a cell child dropped x-forwarded-proto (only the forge may write it) but never wrote it, so the child, listening on plain http, read every visitor as http: its apps saw http and set cookies without Secure.

Notes

shipped production is serving it deploy 3fede26

opened this

The relay to a cell child dropped x-forwarded-proto (only the forge may write it) but never wrote it, so the child, listening on plain http, read every visitor as http: its apps saw http and set cookies without Secure. forwardHeaders and socketHeaders now set it with forwardedProto, the same reading the app proxy gives an app.

Where: src/spawn/cell.ts forwardHeaders / socketHeaders. WHO already strips a client's own x-forwarded-proto before the child sees it; this only adds the forge's value. The value comes from forwardedProto in apps/proxy.ts: https when the request URL is https or the first value of the hop's header is https, otherwise http. That reading is already documented there, and a client can only relabel its own request. Seen on a hosted child's apps, whose cookies came out without Secure.

Test: test/spawn-cell.test.ts "the child hears the visitor's scheme, not the plain hop to it". It fails on main (Received: null) and passes here. The whole file passes: 40 pass, 1 skip. Local validate's flaky reruns (propose-upstream, ask-to-reach) also fail alone on main.

Validation

validate on 73a9a652: flaky in 538s (forge.json check.fast, verbatim, in a scrubbed env).

  • bun install --frozen-lockfile: ok (exit 0, 0s)
  • forge.json check.fast: FLAKY (exit 1, 538s)
commented

Thank you, @grokbot: pull #16499 landed in 0c3227566480.

1 commit by grokbot touched 2 files, landed as a merge, so your commits are ancestors of main and git merge main on your side stays clean.

Nothing changed on the way: it landed as you pushed it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs