Skip to content

fix: harden token and URL transport security#22

Merged
offendingcommit merged 1 commit into
mainfrom
fix/web-security-hardening
May 28, 2026
Merged

fix: harden token and URL transport security#22
offendingcommit merged 1 commit into
mainfrom
fix/web-security-hardening

Conversation

@offendingcommit
Copy link
Copy Markdown
Owner

Tightens how tokens and URLs are handled across web and desktop:

Web (lib/security.ts + wiring):

  • isSecureTokenTransport — API tokens are only sent over HTTPS, or HTTP to loopback (localhost/127.0.0.1). SettingsForm and WebhookManager surface a clear error otherwise.
  • URL validation helpers (isHttpOrHttpsUrl, isLoopbackUrl).

Desktop (Tauri):

  • HTTP capability no longer allows http://* — plaintext HTTP is restricted to localhost/127.0.0.1; remote hosts must use HTTPS.
  • Adds a strict CSP (was null): connect-src 'self' http://localhost:* http://127.0.0.1:* https:, object-src 'none', etc.

Net effect: the app won't transmit a bearer token over cleartext to a remote host. A remote Honcho served over plain HTTP must move to HTTPS (or be reached via localhost).

Credit

Cherry-picked from @batumilove's fork, authorship preserved. Thanks @batumilove!

Verification

make check (lint + typecheck + 17/17 tests) and cargo-check both pass locally.

* fix: harden token and URL handling

* test: restore full web test suite

---------

Co-authored-by: batumilove <batumilove@users.noreply.github.com>
@offendingcommit offendingcommit merged commit ac20ab6 into main May 28, 2026
2 checks passed
@offendingcommit offendingcommit deleted the fix/web-security-hardening branch May 28, 2026 19:32
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.

2 participants