Skip to content

fix(auth): local sign-in works behind trusted HTTPS proxies - #177

Merged
vincentkoc merged 1 commit into
mainfrom
security/codeql-clickclack-secure-cookies-20260827
Aug 27, 2026
Merged

fix(auth): local sign-in works behind trusted HTTPS proxies#177
vincentkoc merged 1 commit into
mainfrom
security/codeql-clickclack-secure-cookies-20260827

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 27, 2026

Copy link
Copy Markdown
Member

Supersedes the cookie-policy approach in #171. That draft remains open and untouched pending maintainer reconciliation.

What Problem This Solves

Fixes an issue where local sign-in could lose OAuth state when an untrusted forwarded-scheme header forced Secure cookies onto loopback HTTP. It also resolves CodeQL alerts 1 and 2 for authentication cookies that did not have a statically guaranteed Secure policy.

Why This Change Was Made

HTTPS is now derived from direct TLS or a verified loopback proxy with one unambiguous forwarded protocol value. Both authentication cookies share that decision, all configured HTTPS public surfaces force Secure cookies, and intentional loopback HTTP development remains supported without adding configuration.

The accepted proxy contract is the repository's existing bundled Nginx example: it overwrites Host, X-Forwarded-For, X-Real-IP, and X-Forwarded-Proto before forwarding to the loopback API. Other proxy topologies must use configured public URLs or establish their own verified edge identity.

User Impact

Local OAuth sign-in continues to work over loopback HTTP, trusted local reverse proxies produce HTTPS callback URLs and Secure cookies, and arbitrary forwarded headers can no longer influence the scheme decision.

Evidence

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(auth): local sign-in works behind trusted HTTPS proxies This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@vincentkoc
vincentkoc marked this pull request as ready for review August 27, 2026 07:50
@vincentkoc
vincentkoc requested a review from a team as a code owner August 27, 2026 07:50
@vincentkoc
vincentkoc merged commit 27bcc19 into main Aug 27, 2026
14 of 15 checks passed
@vincentkoc
vincentkoc deleted the security/codeql-clickclack-secure-cookies-20260827 branch August 27, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant