Skip to content

Security: scope certificate skipping and shorten sessions - #37

Merged
SandObserver merged 2 commits into
mainfrom
security/tls-scope-session-and-origin
Aug 12, 2026
Merged

SandObserver merged 2 commits into
mainfrom
security/tls-scope-session-and-origin

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Decide TLS verification skipping in one place (resolveSkipTls), applying the existing internal-host restriction to the per-item skipTlsVerify flag and the per-request skipTls field, not just the server-wide setting.
  • Return a vouched message on a certificate failure where the skip was requested but not applicable, on both the fetch and ping paths.
  • Default the session idle window to 12 hours, and reissue a token past the halfway mark from the router so an active session is extended; add readToken and refreshSession.
  • Reject a state-changing request that carries no Origin header, rather than allowing it through.
  • Bind the API to 127.0.0.1, which is the only address nginx proxies to.
  • Withhold passwordSet and setupPrompted from /api/auth/check unless the caller is authenticated.
  • Ask before carrying skipTlsVerify across a foreign-config import, via insecureApps and clearSkipTls and a checkbox in the import preview; reuse the existing app.allowSelfSigned and app.selfSignedTip strings so no catalog gains a key.

Testing
All green, plus a live check against a public host with a self-signed certificate. Added 22 tests: certificate-skip scoping across both outbound paths, session renewal and expiry, the origin requirement, the pre-auth reply, and the import decision.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

Turning certificate verification off is now decided in one place and only
ever applies to a host on the local network. The server-wide setting was
already scoped that way; the per-app switch and the per-request flag were
handed straight to the transport, and those are the paths that carry a
stored credential.

Session tokens now expire after 12 hours idle rather than 30 days, and a
session still in use is reissued once it is past halfway, so the shorter
window bounds an unused token without signing anyone out mid-task.
@SandObserver SandObserver added the security Security fix label Aug 12, 2026
The seeding helper posts through an API request context, which is not a
page and so states no origin. Writes now require one, which refused every
seed. The address comes from the same definition the Playwright config
resolves relative paths against, so the two cannot drift apart.
@SandObserver
SandObserver merged commit 1c45edc into main Aug 12, 2026
4 checks passed
@SandObserver
SandObserver deleted the security/tls-scope-session-and-origin branch August 12, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Security fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant