Skip to content

fix(security): redirect header policy, deleted-org email checks, tokens out of the session replay - #880

Merged
fclairamb merged 19 commits into
mainfrom
security/scan-specs-2026-11-15
Nov 15, 2026
Merged

fclairamb merged 19 commits into
mainfrom
security/scan-specs-2026-11-15

Conversation

@fclairamb

@fclairamb fclairamb commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Fixes the four Low findings of the security scan of 2026-11-15.

What changed

  • Redirects drop headers with a resolved ${param:} / ${env:} value (AN1). On a cross-origin redirect, HTTP and JS checks no longer resend a header whose value came from a ${param:} or ${env:} reference. The header is listed in redirect_dropped_secret_headers, and the value never shows up in the output. The worker records the resolved values on the check context, for both in-process and agent runs. A JS check that uses any reference now keeps only the redirect-safe headers past its origin, as checks with secrets already did.
  • Prometheus, WebSocket and RabbitMQ use a shared redirect policy (AN2). The new checkerdef.CredentialRedirectPolicy caps a redirect chain at 10 hops. On a cross-origin hop or an https→http downgrade, it strips Authorization, Proxy-Authorization, Cookie, the configured headers and Referer, and it never resends a request body.
    • Prometheus and WebSocket list the headers they drop.
    • A WebSocket redirect loop now fails with "too many redirects" instead of running until the timeout.
    • RabbitMQ management calls no longer follow redirects: a 3xx response fails the check.
  • Inbound mail for a deleted organization is rejected (AN3). GetCheckByEmailToken now joins organizations and skips deleted ones, on both SQLite and Postgres. Before this fix, such mail recorded results, and notifications also went out through the deleted org's integrations: lookupOrgIdentity only logs a warning when the org is missing.
  • Tokens are kept out of the session replay (AN4).
    • Blocked from the replay: the heartbeat URL, the curl and TCP/UDP push commands, the email check address, its mailto: link and plus-addressing hint, and the SMTP form's delivery address. The copy buttons still copy the full values.
    • The checks list row no longer puts the full address in a title attribute.
    • The require-secret-text lint rule now catches values derived from a secret.

Each fix has a regression test that fails without it, plus a positive control.

Batch gate: make build-backend, golangci-lint, make test (283 packages), typecheck:e2e, lint:e2e and the full Playwright suite (1030 passed, 15 skipped) are all green.

Decided by autopilot

  • None of the four specs had an open question. Their "To verify" items were checked by the implementers; the results are written above.

fclairamb and others added 10 commits November 15, 2026 07:41
…r context

The worker collects the values the env/param references of a job's config
resolved to (env from the resolver, param read back from the server overlay
or, on an agent, from StoredConfig) and hands them to the checker with
checkerdef.WithResolvedReferenceValues. Never logged nor serialized.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… reference

HTTP check: a header whose value contains a resolved ${param:}/${env:} value
is dropped on a cross-origin hop and listed in redirect_dropped_secret_headers.
JS check: the resolved values count as secrets for the redirect strip, so a
check with references but no secrets keeps only the generic headers past its
origin (spec 2026-11-15-01, finding AN1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hat carry a resolved reference value

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at carry a resolved reference value

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…in redirects

Adds checkerdef.CredentialRedirectPolicy: a cross-origin hop (other host or
port, or https -> http) gets no Authorization, Proxy-Authorization, Cookie,
configured header or Referer; the chain is capped at 10. Dropped names are
reported as redirect_dropped_secret_headers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rigin redirects

The handshake client always carries checkerdef.CredentialRedirectPolicy, so a
redirect loop now ends after 10 hops instead of running to the timeout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The URL is built from the configured host, so a redirect is never expected:
the redirect response is the result. Documents the redirect rule of the
Prometheus, WebSocket and RabbitMQ checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ks follow redirects with Go's default header policy

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s follow redirects with Go's default header policy

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.55172% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.72%. Comparing base (e0f9b6a) to head (f04fcd5).

Files with missing lines Patch % Lines
server/internal/secretref/refvalues.go 91.52% 5 Missing ⚠️
server/internal/checkworker/worker.go 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #880      +/-   ##
==========================================
+ Coverage   90.70%   90.72%   +0.01%     
==========================================
  Files        1365     1368       +3     
  Lines      140467   140620     +153     
==========================================
+ Hits       127413   127576     +163     
+ Misses      13045    13035      -10     
  Partials        9        9              
Files with missing lines Coverage Δ
...ver/internal/checkers/checkerdef/redirectpolicy.go 100.00% <100.00%> (ø)
...rver/internal/checkers/checkerdef/resolved_refs.go 100.00% <100.00%> (ø)
server/internal/checkers/checkhttp/checker.go 90.44% <100.00%> (+0.27%) ⬆️
server/internal/checkers/checkjs/checker.go 92.26% <100.00%> (-0.06%) ⬇️
...erver/internal/checkers/checkprometheus/checker.go 95.45% <100.00%> (+0.09%) ⬆️
server/internal/checkers/checkprometheus/promql.go 74.62% <100.00%> (ø)
server/internal/checkers/checkrabbitmq/checker.go 77.21% <100.00%> (+0.29%) ⬆️
server/internal/checkers/checkwebsocket/checker.go 87.61% <100.00%> (+4.43%) ⬆️
server/internal/db/models/check_job.go 100.00% <ø> (ø)
server/internal/db/postgres/postgres.go 95.01% <100.00%> (+<0.01%) ⬆️
... and 3 more

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

fclairamb and others added 7 commits November 15, 2026 07:56
…s rejected

GetCheckByEmailToken now joins organizations and skips deleted ones, so a
token of a deleted org reads as unknown and HandleEmail rejects the mail
instead of recording a result and running the incident pipeline there.

Before this fix the notification job also dispatched through the deleted
org's integrations: lookupOrgIdentity only logs a missing org.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mail checks of a deleted organization

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ail checks of a deleted organization

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eplay

The heartbeat URL, its curl and push commands, the email check address,
its mailto link and plus-addressing hint now render under ph-no-capture
(SecretText or a blocked container). The checks list drops the title that
carried the full email address, and the SMTP check form blocks the
delivery address. The endpoint cards move to
components/checks/check-endpoints.tsx so they can be unit-tested.

secret-local/require-secret-text now follows values derived from a secret
(templates, concatenations, call arguments) and reports them rendered in
any native element or in a recorded attribute (title, href, aria-label,
alt, placeholder).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ddress are recorded by the unmasked session replay

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dress are recorded by the unmasked session replay

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@fclairamb fclairamb changed the title fix(security): strip referenced headers and credentials on redirects, deleted-org email checks, heartbeat/email tokens out of replay fix(security): redirect header policy, deleted-org email checks, tokens out of the session replay Nov 15, 2026
@fclairamb fclairamb added the implemented Every spec of the PR is implemented and its batch gate was green label Nov 15, 2026
@fclairamb
fclairamb enabled auto-merge (squash) November 15, 2026 09:15
@fclairamb
fclairamb merged commit cc8d0a5 into main Nov 15, 2026
40 checks passed
@fclairamb
fclairamb deleted the security/scan-specs-2026-11-15 branch November 15, 2026 09:36
fclairamb added a commit that referenced this pull request Nov 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.50.0](v0.49.3...v0.50.0)
(2026-11-15)


### Features

* incident insights page and uptime report insights
([#862](#862))
([e0f9b6a](e0f9b6a))


### Bug Fixes

* batch-gate fixes for check worker wake-up, disable toggle, ui-state
order and E2E races
([#885](#885))
([829f43b](829f43b))
* **deps:** update module github.com/slack-go/slack to v0.36.0
([#878](#878))
([a50d878](a50d878))
* free a restarted worker's check leases, quieter status page logs,
phone checks menu
([#879](#879))
([5543a4c](5543a4c))
* **security:** redirect header policy, deleted-org email checks, tokens
out of the session replay
([#880](#880))
([cc8d0a5](cc8d0a5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
fclairamb added a commit that referenced this pull request Nov 16, 2026
CheckConfigView renders the config keys the check response lists in
redactedConfigKeys (heartbeat/email token, SMTP delivery_to) through
SecretText, so the Configuration card no longer leaks the token #880 hid
in the endpoints card. Other rows stay readable. The design reference
documents the rule (spec 2026-11-16-02).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge autopilot implemented Every spec of the PR is implemented and its batch gate was green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant