You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: requireAuth throws on missing/malformed Host header; token saves requested during an in-flight save are dropped #504
1. requireAuth can throw (src/server/signalling/utils.ts)
When a non-loopback request has no Authorization header, it falls back to ?token= by calling new URL(req.url, "http://" + req.headers.host). If the Host header is missing or malformed, new URL throws, so the caller gets an unhandled exception instead of a 401.
2. Token save can be dropped (src/server/tokenStore.ts) save() returns early when isSaving is true, even for save(true). A forced save requested while another is in flight (new token, expiry purge) is silently lost until the next save. The window is narrow, so this is a hardening issue.
Steps to reproduce
Send an unauthenticated request from a non-loopback address with no Host header and a ?token= query, to an endpoint that uses requireAuth.
Observe an exception rather than a 401 response.
Expected behavior
requireAuth returns 401 (or authenticates via ?token=); every forced token save is persisted.
Additional context
Neither module has unit tests; #503 adds some. AI assistance (Claude) was used to find and fix these.
Activity
github-actions commentedon Nov 19, 2026
Discussions are carried on Discord.
Instead of commenting here, go to the Discord channel.
macOS and macOS-related issues are not supported at the moment. We are looking for funding to support macOS and would appreciate sponsorships.
If you find this project useful, a GitHub star would be appreciated.
gitcordapp commentedon Nov 20, 2026
Link your account with Gitcord
Thanks for opening this issue, @ArnabOPP!
To receive Discord notifications and contributor tracking for this organization:
/link ArnabOPP/verify-link ArnabOPP)Once linked, Gitcord can notify you about assignments, mentions, and more.
— Posted by Gitcord