Skip to content

fix(server): SameSite=Lax for the tailnet session, and log why a tailnet request was refused (#240) - #241

Merged
davison merged 10 commits into
mainfrom
task/240-samesite-lax-for-the-tailnet-session-and
Sep 30, 2026
Merged

davison merged 10 commits into
mainfrom
task/240-samesite-lax-for-the-tailnet-session-and

Conversation

@davison

@davison davison commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Closes #240

The tailnet session cookie is now SameSite=Lax, so a home-screen shortcut or a link from another app opens md-notes logged in. Every tailnet request sent to the login page or refused is logged with its reason. Milestone M13 (#239). This adopts capture #238, which task finish closes.

What changed

  • internal/server/tailnet.go:
  • internal/session: Verify says why a value was refused. Check is unchanged, and is Verify without the reason.
  • internal/token: DerivePrevious gives the key of the token before the last rotation, in memory only. It is used for the log line and never to accept a session.
  • internal/server/getroutes_test.go pins the GET routes, each audited as a read in the plan. A new GET route fails the test until someone adds it to that list.
  • Docs: the introduction's Authentication section, docs/running.md and contrib/mdn.1.

Requirements

  • M13-R1:
    • Attribute tests: the two cookie-attribute tests assert SameSite=Lax, and failed against today's code.
    • e2e, in Chromium behind TLS: ui/e2e/tailnet-session.test.mjs serves a second https site, attacker.test, and the proxy records whether the browser sent the cookie on each request.
      • A link from that site carries the session and serves the app.
      • Its auto-submitted form POSTs to /api/clip and /login, a credentialed fetch and an iframe all arrive without the cookie and are refused.
      • A raw request carrying the cookie with a foreign Origin gets 403, and the note is untouched.
      • Against the v0.3.1 (Strict) binary, the cross-site navigation test fails: the login page is shown.
    • GET audit: in the plan on SameSite=Lax for the tailnet session, and log why a tailnet request was refused #240, pinned by TestEveryGETRouteHasBeenAuditedAsARead.
  • M13-R2: TestTailnetRefusalsAreLoggedWithTheirReason covers every reason and asserts that no secret appears. TestTailnetLoginNamesTheBrowserFamily, TestTailnetRefusalLogIsBounded, TestBrowserFamily and TestVerifySaysWhy cover the rest. Measured against the built daemon; the lines are in the Decision.
  • M13-R3: every other session test passes unchanged: the restart, rotation, forgery and host-binding tests, the idle limit, refresh, the throttle and loopback. The only edits to existing assertions are Strict → Lax.
  • M13-R4 (this task's share): the introduction says why Lax (the home-screen shortcut), what Lax still withholds, that the upgrade to v0.3.2 needs nothing from users, and what the refusal log says. docs/running.md and the man page say the same in short.

Decisions

Checks

make check and make e2e pass locally: 124 of 124, Chromium 153.

No feat commit: the commits are fix, test and one docs for the prose.

🤖 Generated with Claude Code

davison and others added 5 commits September 30, 2026 15:44
…fore a rotation (#240)

session.Verify returns ErrMalformed, ErrSignature, ErrExpired or
ErrFuture; Check is Verify without the reason. token.Store keeps, in
memory only, the token it held before the last rotation it saw, and
DerivePrevious lets the log say a session was signed before the rotation
rather than call it a bad signature. Nothing new is on disk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est was refused (#240)

The session cookie is SameSite=Lax, so a top-level navigation from
outside the site - a home-screen shortcut, another app's link - carries
it (M13-R1; the operator's decision on #239). Cross-site writes, fetches
and frames still go without it, and the Origin check still refuses a
cookie-authenticated request with a foreign Origin. A test pins the set
of GET routes, each audited as a read.

Every tailnet request sent to the login page or refused is logged with
its reason, and a login names the browser family from a coarse
User-Agent parse (M13-R2). No cookie value, token, key or query is
logged. The same reason from the same address is logged once a minute,
and all callers together at most 30 lines a minute, with a count of
what was left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, nothing else from it does (#240)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#240)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The introduction's Authentication section says why Lax (the home-screen
shortcut), what it still withholds, that v0.3.2 needs nothing from
users, and what the refusal log says; docs/running.md says the same in
short.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davison

davison commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Review — 942ee7c

The head had not moved when I started. I reviewed it in my own detached worktree and ran everything below against a daemon built from it: temporary token, state and root under my scratch directory, ports 874x/875x.

Findings

1. blocking: log injection through the request path (M13-R2). internal/server/tailnet.go:160 writes path.Clean("/"+r.URL.Path) into the log as it is. r.URL.Path is percent-decoded, so %0d%0a becomes a real line break and %1b a real ESC. Only the Host and the Origin go through %q. An unauthenticated caller on the tailnet can write lines that look like the daemon's own, and so can any web page the user visits. A cross-site <img> reaches exactly this refusal path; my matrix below shows it arriving without the cookie and getting a logged 401.

$ curl -g -H 'Host: box.tailnet.test' -H 'X-Forwarded-For: 100.64.0.50' \
  "$U/api/x%0a2026/09/30%2000:00:00%20tailnet%20login%20from%20100.64.0.1%20(Chrome%20on%20Android)%1b[31mRED%1b[0m"
$ cat -A daemon.log
2026/09/30 15:51:43 tailnet: 100.64.0.50 GET /api/x$
2026/09/30 00:00:00 tailnet login from 100.64.0.1 (Chrome on Android)^[[31mRED^[[0m refused (401 unauthorized): no session cookie$

The same happens with /r/a%0d%0aFORGED%20LINE on a navigation, which gives …GET /r/a^M$ / FORGED LINE sent to the login page…. The forged line is a fake successful login, which is the line an operator trusts most. TestTailnetRefusalsAreLoggedWithTheirReason never sends a control character.

Fix I'd expect: quote the path, e.g. %q or strconv.QuoteToASCII, or escape every byte below 0x20 plus 0x7f, before truncating. Do the same for the address for good measure. Go's server already rejects CTLs in header values, so XFF itself was not injectable in my test: 400. Truncate after escaping, or on a rune boundary, since v[:n] can split a UTF-8 sequence. Add a test with %0a, %0d and %1b in the path.

2. blocking: several tailnet refusals are not logged at all, and three docs say every one is (M13-R2, M13-R4). R2 says "every tailnet request sent to the login page or refused is logged with its reason". docs/introduction.md:489, docs/running.md:161 and contrib/mdn.1:65 repeat it. These refusals write nothing:

  • /login 403 cross_origin (tailnet.go:235)
  • /login 400, not https (tailnet.go:254). This is a proxy misconfiguration, exactly what the log exists to diagnose.
  • /login 400, unreadable form (:243)
  • /login 405 (:229)
  • /login 429 too_many_attempts (:272)
  • the guard's 403 bad_host for a forwarded request carrying a loopback Host (server.go:555). That is the "proxy rewrote the Host" case, and it is R2's "wrong host".
  • the guard's 403 bad_host for an absolute-form target (server.go:542)

Measured:

$ curl -H 'Host: 127.0.0.1:8751' -H 'X-Forwarded-For: 10.4.0.1' -H 'X-Forwarded-Proto: https' $U/api/roots   -> 403 bad_host (loopback Host)
$ curl -H 'Host: box.tailnet.test' -H 'X-Forwarded-For: 10.4.0.2' --data token=x $U/login               -> 400 (not https)
$ curl -H 'Host: box.tailnet.test' ... -H 'X-Forwarded-Proto: https' -H 'Origin: https://evil.example' --data token=x $U/login -> 403
new log lines: 0

In my Chromium matrix, the cross-site form POST to /login got 403 and left no line either. Fix: route each of these through logRefusal with its reason. The loopback-Host one applies only when tailnet_host is set, as the default branch already does. Otherwise narrow R2's "every" and the three docs, but that changes a requirement and needs a Decision.

3. nit: the GET-route guard catches only one spelling of a new route. internal/server/getroutes_test.go:36 greps server.go for HandleFunc("GET …" on one line. I added an unaudited GET /api/r/{slug}/wipe four ways:

s.mux.HandleFunc("GET …/wipe", …) in server.go             -> FAIL (caught)
s.mux.Handle("GET …/wipe", http.HandlerFunc(…))            -> ok   (missed)
the HandleFunc in another file of the package              -> ok   (missed)
s.mux.HandleFunc(\n\t\t"GET …/wipe", …) across two lines   -> ok   (missed)

The method-less check has the same holes. Today every route really is a single-line HandleFunc in server.go, so this is not a live gap. But this test is what R1's "no request the daemon serves on GET changes state" rests on from now on. Fix: walk every non-test .go file in the package with go/parser and collect the string-literal first argument of any Handle/HandleFunc call. Or register through one helper that records its patterns, and compare those.

4. nit: a typed URL did not lose the session under Strict (docs/introduction.md:445-447). The introduction lists "a URL typed into a new tab" among the navigations Strict withheld the cookie on. With SameSite reverted to Strict, the e2e's logIn()/home() still reach the app through page.goto. That is a browser-initiated navigation with Sec-Fetch-Site: none, the same as a typed URL or a bookmark. The first test then failed only at sameSite: 'Strict' !== 'Lax'. Strict withholds the cookie on navigations another site or app starts, not on typed ones. Drop "a URL typed into a new tab" from that list. It can stay in the list of what Lax allows.

5. nit: the upgrade claim leaves out the one-time ask that the plan admits (docs/introduction.md:454-456). The plan says "Until that reissue, a home-screen launch can still ask once." The doc says only that the upgrade "needs nothing from you". On the e-ink tablet, the first shortcut launch after the upgrade still presents its v0.3.1 Strict cookie, which is withheld, so the tablet gets the login page once. Say so in one clause, so the operator's first test of v0.3.2 does not read as a failed fix.

6. nit: "in the last minute" can be hours late (tailnet.go:155, refusals.go:36). The left-out count is reported by the first refusal after the window closes, whenever that comes. After a flood at 03:00 and quiet until 09:00, the 09:00 line says "578 tailnet refusals not logged in the last minute". Word it as "in the minute from 03:00:12" (the window start), or keep it but say "in the last capped minute".

What I verified, and how

  • Commit types, all five, checked against their diffs. b49f487 fix(session) changes code and tests. 8c4036b fix(server) changes code and tests. 6ff6096 test(e2e) changes the e2e test. 5f25679 fix(man) changes contrib/mdn.1, correctly not docs. 942ee7c docs touches only docs/introduction.md and docs/running.md. CI ran check and e2e, and both passed.
  • make check: exit 0. node --test e2e/tailnet-session.test.mjs: 4 of 4 pass.
  • Revert. I set SameSite back to SameSiteStrictMode and rebuilt. The Go tests TestTailnetSessionIsRefreshedOnUse and TestTailnetLoginSetsAHostScopedCookie fail. In the e2e, "keeps a login…" fails on the attribute, and "carries the session on a navigation from another site" fails because the link lands on the login page (actual: 1, expected: 0). I restored it afterwards.
  • R1, my own matrix in Chromium 153. A TLS proxy at mdn-review.tailnet.test, a second https site at attacker.test, and the proxy recording whether the cookie arrived. The cookie was sameSite=Lax httpOnly secure path=/, Max-Age 30.00 days.
    • Carries the cookie (cross-site, navigate): a link to / (200, the app, not the login page), a link to /api/roots (200), and window.open('/') (200, the app).

    • Never carries it:

      • top-level form POST navigations to /api/clip, /login (403 from the Origin check), /api/r/notes/resources (multipart), /api/r/notes/source/csrf.md, /api/roots and /, all 401 apart from /login;
      • an iframe;
      • <img>, <script> and stylesheet subresources;
      • fetch with credentials: include, both no-cors and cors;
      • a no-cors fetch POST;
      • PUT and DELETE, which stopped at a cookie-less OPTIONS preflight answered 401;
      • sendBeacon;
      • EventSource({withCredentials: true}).

      The notes directory held only index.md afterwards.

    • Lax-allowing-unsafe, measured. Every cross-site POST was sent 0.4 to 3.2 s after the login, well inside Chromium's two-minute window, and none carried the cookie. So the explicit Lax gets no such window.

  • GET audit. I read every GET handler. tree, tags, search, note, raw and diagram only read files and fill in-memory caches. source adds to source.Store.versions in memory, and only for files that exist. events starts the root's watcher in memory. Nothing writes to disk, which matches the plan's table.
  • Login CSRF. It is not reachable. The login POST needs the daemon's current token, which only its owner holds. A cross-site login POST is refused on Origin before the form is read: 403, measured. Lax changes nothing here, since the login presents no cookie.
  • R2, no secrets. Against the built daemon I sent the token plus a suffix as a bearer, a query ?t=SUPERSECRETQUERY, a real session cookie, a tampered one, and a login whose UA carried SECRET-DEVICE-ID-123. grep -c finds 0 of each, and 0 Mozilla. The login line read tailnet login from 100.64.0.55 (Chrome on Android), which is coarse, from a fixed vocabulary.
  • R2, reasons. A running rotation gave signed with the token before the last rotation. After a restart the same cookie gave bad signature (another token, a token replaced while the daemon was stopped, …), as the Decision states. A MAC with a changed byte gave bad signature. A Host with a port gave refused (403 bad_host): Host "box.tailnet.test:8443" is not box.tailnet.test, and a foreign Origin was refused as cross_origin.
  • R2, flood. 300 requests with varying XFF, 200 from one XFF across varying paths and 100 bad Hosts, all in about 2 s, added 22 lines. That makes 30 for the minute with the 8 before. The first refusal after the minute logged 578 tailnet refusals not logged in the last minute, which is 600 − 22.
  • R3. Loopback /api/roots gives 200 unauthenticated. The only edits to existing tests are Strict → Lax. Verify keeps Check's order, with shape before MAC and constant-time compare, and Check is unchanged. The throttle, idle limit and reissue are untouched and their tests pass.
  • R4. Outside docs/milestones/ (history), git grep -i samesite finds no Strict left. The introduction, running.md and mdn.1 name Lax and why. Their "every refusal is logged" claim is finding 2, and their wording is findings 4 and 5.

Verdict: changes requested

davison and others added 4 commits September 30, 2026 15:58
…d log every tailnet refusal (#240)

Review findings 1 and 2 and nit 6 on PR #241:
- the path, the address, the method, the Host and the Origin go through
  logSafe: cut on a rune boundary, then every non-printable character
  written as its Go escape, so %0a, %0d, %1b, U+0085 and U+2028 in a path
  cannot forge a line or a terminal sequence;
- the login form's refusals (405, 403 cross_origin, 400 unreadable form,
  400 not https, 429) and the guard's forwarded-loopback-Host and
  absolute-form bad_host refusals are logged with their reasons, under the
  same bounds, and a wrong token's line says why;
- the count of refusals left out of a capped minute names the minute it
  is about, since it is written with the next refusal, however late.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
)

Review nit 3 on PR #241: the GET audit parsed only single-line
HandleFunc calls in server.go. It now walks every non-test source in the
package with go/parser and takes the literal pattern of any Handle or
HandleFunc call, and refuses a pattern that is not a literal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd every logged refusal (#240)

Review nits 4 to 6 and the docs half of finding 2 on PR #241: a typed or
bookmarked URL carried the cookie under Strict too; the first
home-screen launch after the upgrade to v0.3.2 asks once; the refusal
list includes the login form's and the Host guard's; the left-out count
is written with the next refusal and names its minute.

Closes #240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davison

davison commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Review — 45bb114

Round two covers the fix pass for round one (#241 (comment)), with the Decision addendum #240 (comment). I reviewed it in a fresh detached worktree at this head, with a daemon built from it on port 8761 and a scratch token and root.

Findings

1. blocking: the wrong-token line is not bounded, and the premise that the throttle bounds it is false. The addendum keeps tailnet login refused from …: not the current token outside refusalLog "since the login throttle already bounds it" (internal/server/tailnet.go:303). The throttle does not bound it for a caller who varies X-Forwarded-For. Past loginFree in total, each failure only waits loginDelay, and nothing queues them, as throttle.go's own comment says. The per-key refusal at loginMax never trips when every request claims a new address. Measured with 2000 wrong-token POSTs to /login, 200 in parallel, each with its own XFF:

$ python3 flood.py 2000 200
Counter({401: 2000}) 5.7s
$ grep -c 'tailnet login refused from' daemon.log
2000

That is about 350 lines a second, from anything the tailnet ACL admits. This is the very flood the original Decision says neither a dead cookie nor "a hostile node on the tailnet" should be able to write. The introduction also says every caller together gets "at most thirty lines a minute" (docs/introduction.md:521), which this line breaks.

Fix: send this line through logRefusal, e.g. s.logRefusal(r, "refused (401 unauthorized)", "the login token is not the current token"), so the per-address dedupe and the cap of 30 apply as they do to every other refusal. Add a case to TestTailnetRefusalLogIsBounded that varies XFF on wrong-token logins. If the unbounded line is kept on purpose, the introduction's bound has to say so, and the Decision needs a true reason.

No other findings. Round one's finding 2 is otherwise closed, and so are finding 1 and nits 3 to 6. The evidence is below.

What I verified, and how

  • Commit types, all four new commits, checked against their diffs.

    • b107985 fix(server): code and tests.
    • 565e3fd test(server): getroutes_test.go only.
    • 83d0efc test(session): session_test.go only, reordering one import line. The subject says "reason table", but the type is honest.
    • 45bb114 docs: docs/introduction.md only, which is correct.

    make check exits 0. The tailnet e2e suite passes 4 of 4. gofmt -l internal/ is clean. CI is green. The Closes davison/md-notes#240 in 45bb114's body is the stated workaround, not a finding.

  • Finding 1 (escaping) holds. I reverted logSafe to return the cut string unescaped, and TestTailnetLogCannotBeForged failed, as did the related log tests. With logSafe restored, I sent these to the built daemon, with cat -A on the result:

    • Path:
      • %0a/%0d/%1b: covered by the test.
      • invalid UTF-8 %ff%fe%c3b: logged as /api/a\xff\xfe\xc3b.
      • RLO, ZWSP and BOM: logged as ‮evil​zw.
      • a literal backslash-n and quote: logged as /x\\n\"fake, so an escape cannot be imitated.
    • Forwarded address:
      • RLO: logged as 10.200.0.3‮1.0.46.001.
      • invalid bytes: logged as \xff\xfe.
      • 3000 digits: cut to 64 plus ….
      • The same address on a successful login line: tailnet login from 10.200.0.13‮ (Chrome on Android).
    • Origin: RLO plus \xff on /login was logged as Origin "https://a‮\xff".
    • Host: RLO, CTL or DEL in the Host is refused by Go with a 400 before the guard runs. A Host with a port is quoted.
    • Method: M%0aX stays literal, since a method is an HTTP token. Go refuses a non-token method with a 400.
    • User-Agent: a UA carrying RLO and invalid bytes gave Chrome on Android. The family comes from a fixed vocabulary, so no UA byte reaches the log. A UA with ESC gets a 400 from Go.
    • Long input: 1000 four-byte emoji followed by %0a was cut to 200 runes plus …, and the %0a never arrived. 5000 %ff became 200 runes. The escaped width stays bounded, at most 10 bytes a rune.
    • Truncation: the cut is by rune and comes before escaping, so it can land neither mid-escape nor mid-rune. There is one cosmetic effect, not a finding: once the string is over the limit, []rune turns invalid bytes into U+FFFD, so they show as � rather than \xff.
    • Bidi and zero-width characters: they matter only as a way to mislead a human reading the log. strconv.Quote escapes them because they are not unicode.IsPrint, so they cannot reorder or hide text here.
  • Finding 2 (every refusal logged). I walked every refusal in guardTailnet, loginHandler and guard:

    • guardTailnet: bearer 401, challenge 401 or login page, cross_origin, loopback_only.
    • /login: 405, 403 cross_origin, 400 for an unreadable form, 400 for not https, 429, 401 wrong token.
    • guard: bad_host for a forwarded loopback Host, for an absolute-form target, and for another Host.

    Each writes a line, and all but the wrong-token one go through logRefusal, which is finding 1 above. The only silent exit is a client that disconnects during the throttle wait, and it gets no response either.

  • Nit 3 (route audit). I tried to slip GET /api/r/{slug}/wipe past the go/parser test. These were all caught:

    • mux.Handle;
    • a call spread over two lines;
    • a call in another file;
    • a loop variable as the pattern (refused as not a literal);
    • "GET\t/…";
    • http.DefaultServeMux.HandleFunc in an init.

    Only a method value got through, hf := s.mux.HandleFunc; hf("GET …", h). It is contrived enough that I do not ask for it. Paths the guard answers itself, like /login, are outside any mux test by construction.

  • Nits 4 to 6, wording against behaviour.

    • Typed or bookmarked URLs are now described as carrying the cookie under Strict. That matches my round-one revert measurement and The e-ink tablet's home-screen shortcut asks for the token every time: SameSite=Strict withholds the cookie #238's report that the tablet stayed logged in when the URL was typed.
    • The one token paste after the upgrade is stated, with the reason.
    • The left-out count now reads N tailnet refusals not logged in the minute from HH:MM:SS, which I measured in round one and which the updated test pins.
    • The refusal list in the introduction matches the code.

Verdict: changes requested

…240)

Review round two on PR #241: the line was written for every failed
login, and the throttle's delay does not bound it for callers varying
X-Forwarded-For (2000 lines in 5.7 s, measured). It now goes through
logRefusal, with the per-address dedupe and the 30-a-minute cap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davison

davison commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Review — 950f7ce

Round three covers the fix for round two's blocking finding (#241 (comment)), with the corrected addendum #240 (comment). I reviewed it in a fresh detached worktree at this head.

Findings

None.

What I verified, and how

  • The flood, repeated against a build of this head. I sent the same 2000 wrong-token POSTs to /login as in round two: 200 in parallel, each with its own X-Forwarded-For, under a scratch token and root on port 8761.
    Counter({401: 2000}) 5.4s
    lines: 30
    tailnet: 10.0.0.1 POST /login refused (401): not the current token
    
    That compares with 2000 lines on 45bb114. After the minute, the next wrong login logged tailnet: 1970 tailnet refusals not logged in the minute from 16:11:43, and 30 + 1970 = 2000. The escaping is unchanged, since the address now goes through logRefusal's logSafe.
  • Revert. I put tailnet.go back to 45bb114's version with the new tests kept. TestTailnetRefusalLogIsBounded fails with 50 wrong logins from varying addresses in a minute: 50 lines, want the cap, 30, and TestEveryTailnetRefusalIsLogged fails on the old line format. With the fix restored, both pass.
  • Nothing else changed. git diff 45bb114..950f7ce touches internal/server/tailnet.go (the one call plus a comment) and internal/server/tailnet_log_test.go (the new flood case and the updated expected line). No doc or man page quotes the old tailnet login refused from format. The introduction's "a token that is not the current one" and its bound of thirty a minute are now both true.
  • Commit type. 950f7ce fix(server) changes code and tests, so the type is honest.
  • Checks. make check exits 0, the tailnet e2e suite passes 4 of 4, gofmt -l internal/ is clean, and CI is green.

My round-one and round-two findings are all closed.

Verdict: approve

@davison

davison commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Operator confirmation: reviewed and accepted by @davison as both author and operator (pure solo tier, SPEC §5) — no independent principal exists in this project.

@davison
davison merged commit 8a27726 into main Sep 30, 2026
3 checks passed
davison added a commit that referenced this pull request Sep 30, 2026
…d log every tailnet refusal (#240)

Review findings 1 and 2 and nit 6 on PR #241:
- the path, the address, the method, the Host and the Origin go through
  logSafe: cut on a rune boundary, then every non-printable character
  written as its Go escape, so %0a, %0d, %1b, U+0085 and U+2028 in a path
  cannot forge a line or a terminal sequence;
- the login form's refusals (405, 403 cross_origin, 400 unreadable form,
  400 not https, 429) and the guard's forwarded-loopback-Host and
  absolute-form bad_host refusals are logged with their reasons, under the
  same bounds, and a wrong token's line says why;
- the count of refusals left out of a capped minute names the minute it
  is about, since it is written with the next refusal, however late.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davison
davison deleted the task/240-samesite-lax-for-the-tailnet-session-and branch September 30, 2026 15:14
davison added a commit that referenced this pull request Sep 30, 2026
)

Review nit 3 on PR #241: the GET audit parsed only single-line
HandleFunc calls in server.go. It now walks every non-test source in the
package with go/parser and takes the literal pattern of any Handle or
HandleFunc call, and refuses a pattern that is not a literal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davison added a commit that referenced this pull request Sep 30, 2026
…nd every logged refusal (#240)

Review nits 4 to 6 and the docs half of finding 2 on PR #241: a typed or
bookmarked URL carried the cookie under Strict too; the first
home-screen launch after the upgrade to v0.3.2 asks once; the refusal
list includes the login form's and the Host guard's; the left-out count
is written with the next refusal and names its minute.

Closes #240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

SameSite=Lax for the tailnet session, and log why a tailnet request was refused

1 participant