Ben Barclay
dd28f2ac9c
fix(dashboard): trust non-web WS origins on OAuth-gated binds after ticket auth ( #37870 )
...
Generalises #37747 . The WS Origin guard (_ws_host_origin_is_allowed) only
trusted the packaged Electron app's non-web origin (file:// / null / app://)
when the bind was NOT OAuth-gated. The packaged Hermes Desktop renderer loads
over file://, so when it drives a remote OAuth-gated gateway its /api/ws
upgrade was rejected with HTTP 403 even though _ws_auth_ok had already
validated the single-use ?ticket= one line earlier.
This guard runs only AFTER _ws_auth_ok has accepted the WS credential, which
is the real auth boundary in every mode:
* loopback bind -> legacy dashboard session token
* non-loopback --insecure -> legacy session token (Tailscale / LAN, #37747 )
* OAuth-gated public bind -> single-use, 30s-TTL, identity-bound ?ticket=
A non-web origin can only come from a native client; a DNS-rebinding attack
always arrives from an http(s) origin and is still match-checked against the
bound host. So once the upstream credential check has passed, the Origin guard
adds nothing for a non-web origin. Collapsed the loopback/non-gated special
cases to 'return True' for non-web origins.
http(s) origins keep the strict same-host check, so browser DNS-rebinding
defence is unchanged.
Tests: gated file:///null/app:// now asserted ALLOWED; cross-site http(s)
still rejected on gated and loopback binds; #37747 's loopback and
non-loopback-insecure cases retained. 37/37 test_dashboard_auth_ws_auth +
test_web_server_host_header pass.
2026-06-03 14:32:53 +10:00
..
2026-02-26 03:20:08 +03:00
2026-05-27 02:12:27 -07:00
2026-05-19 11:10:51 -07:00
2026-05-28 22:26:25 -07:00
2026-05-25 01:20:33 -07:00
2026-04-07 17:19:07 -07:00
2026-05-28 22:26:25 -07:00
2026-04-26 05:43:31 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 00:43:32 -07:00
2026-05-28 22:26:25 -07:00
2026-04-21 14:31:48 -05:00
2026-06-01 09:57:10 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-02 12:19:44 -05:00
2026-05-28 22:26:25 -07:00
2026-05-28 05:47:30 -07:00
2026-05-29 02:24:48 -07:00
2026-05-27 09:38:58 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-04-24 03:00:33 -07:00
2026-05-08 14:27:40 -07:00
2026-05-24 04:25:32 -07:00
2026-05-19 14:51:21 -07:00
2026-05-18 20:01:34 -07:00
2026-05-18 10:14:38 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 13:22:54 -07:00
2026-05-28 15:14:05 +10:00
2026-05-15 14:45:43 -07:00
2026-05-28 22:26:25 -07:00
2026-04-23 23:28:34 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 15:14:05 +10:00
2026-05-28 22:26:25 -07:00
2026-04-09 16:24:53 -07:00
2026-04-29 23:18:55 -07:00
2026-05-28 22:26:25 -07:00
2026-05-25 01:20:33 -07:00
2026-05-28 15:50:25 +10:00
2026-06-02 20:29:54 -04:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 12:16:15 -07:00
2026-05-28 22:26:25 -07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-13 09:34:15 -07:00
2026-04-21 14:23:45 -07:00
2026-05-28 22:26:25 -07:00
2026-04-17 19:03:26 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-04-29 23:18:55 -07:00
2026-06-01 11:28:56 +10:00
2026-05-28 22:26:25 -07:00
2026-04-28 01:18:09 -07:00
2026-04-24 05:09:08 -07:00
2026-05-29 23:45:05 -07:00
2026-04-24 05:09:08 -07:00
2026-05-18 17:39:50 +00:00
2026-05-28 22:26:25 -07:00
2026-05-09 18:43:40 -07:00
2026-05-07 05:27:47 -07:00
2026-05-07 05:27:47 -07:00
2026-05-31 13:59:56 +05:30
2026-05-28 22:26:25 -07:00
2026-06-01 16:58:58 -07:00
2026-06-01 16:58:58 -07:00
2026-04-25 18:47:53 -07:00
2026-05-31 03:19:37 -07:00
2026-06-02 00:16:11 -04:00
2026-06-02 21:16:41 +10:00
2026-05-27 02:12:27 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 02:12:27 -07:00
2026-05-29 12:17:12 +10:00
2026-05-27 02:12:27 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 02:12:27 -07:00
2026-05-29 12:17:12 +10:00
2026-05-27 02:12:27 -07:00
2026-06-03 14:32:53 +10:00
2026-05-27 02:12:27 -07:00
2026-04-30 06:43:22 -04:00
2026-05-28 22:26:25 -07:00
2026-05-12 13:59:22 -04:00
2026-05-28 22:26:25 -07:00
2026-06-02 20:49:44 -05:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 11:04:46 -07:00
2026-04-20 22:14:29 -07:00
2026-04-20 22:14:29 -07:00
2026-04-17 05:08:07 -07:00
2026-05-03 03:25:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 13:36:33 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 15:14:05 +10:00
2026-06-01 13:27:30 +10:00
2026-05-13 18:40:14 -07:00
2026-05-28 22:26:25 -07:00
2026-05-04 15:31:15 -04:00
2026-05-28 22:26:25 -07:00
2026-04-09 16:24:53 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 17:54:17 -07:00
2026-05-30 23:05:56 -07:00
2026-03-14 12:11:23 -07:00
2026-06-02 11:59:27 +10:00
2026-05-28 22:26:25 -07:00
2026-05-29 12:36:59 -07:00
2026-05-28 03:25:32 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 17:46:56 -05:00
2026-04-24 04:46:17 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 23:45:05 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 01:23:06 -07:00
2026-06-02 20:30:13 -04:00
2026-05-28 22:26:25 -07:00
2026-04-29 20:33:29 -07:00
2026-05-28 00:19:31 -07:00
2026-05-21 19:17:45 -07:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-05-30 01:40:57 -07:00
2026-05-18 20:17:10 -07:00
2026-05-28 21:00:46 -07:00
2026-05-18 21:33:08 -07:00
2026-05-28 22:26:25 -07:00
2026-05-30 01:40:49 -07:00
2026-05-30 01:40:57 -07:00
2026-06-01 20:26:57 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 19:02:55 -07:00
2026-05-18 20:47:01 -07:00
2026-05-31 01:16:33 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 19:02:55 -07:00
2026-05-23 23:10:36 -07:00
2026-05-07 13:04:41 -07:00
2026-05-07 13:04:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 17:50:42 -07:00
2026-03-29 21:54:36 -07:00
2026-05-06 03:50:59 -07:00
2026-05-31 17:46:56 -05:00
2026-05-19 01:28:32 -07:00
2026-06-02 20:29:54 -04:00
2026-05-07 05:17:03 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 12:32:19 -07:00
2026-05-28 22:26:25 -07:00
2026-05-30 07:45:26 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 22:29:48 -07:00
2026-05-20 09:18:23 -07:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-04-17 06:33:21 -07:00
2026-05-31 03:19:37 -07:00
2026-04-25 18:47:53 -07:00
2026-04-16 01:16:14 -07:00
2026-05-29 12:32:35 -07:00
2026-04-24 04:58:46 -07:00
2026-04-08 19:58:16 -07:00
2026-05-29 23:45:05 -07:00
2026-05-28 22:26:25 -07:00
2026-05-30 20:57:01 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 00:19:31 -07:00
2026-05-13 18:40:14 -07:00
2026-04-13 04:33:52 -07:00
2026-05-29 02:24:48 -07:00
2026-06-01 06:32:48 +05:30
2026-05-28 22:26:25 -07:00
2026-05-29 23:45:05 -07:00
2026-05-09 23:17:25 -07:00
2026-06-02 06:31:37 -07:00
2026-05-06 09:08:33 -07:00
2026-05-17 02:29:41 -07:00
2026-04-21 05:19:43 -07:00
2026-05-28 22:26:25 -07:00
2026-03-16 06:07:45 -07:00
2026-05-05 04:37:47 -07:00
2026-05-30 00:22:46 -07:00
2026-03-14 10:35:14 -07:00
2026-05-23 17:49:47 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 00:59:42 -07:00
2026-05-31 17:46:56 -05:00
2026-05-25 01:41:19 -07:00
2026-05-24 18:04:54 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 13:02:25 -07:00
2026-05-17 13:54:12 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-24 18:07:47 -07:00
2026-05-29 22:29:48 -07:00
2026-05-28 22:26:25 -07:00
2026-05-25 01:20:33 -07:00
2026-05-30 02:53:42 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 15:02:26 -07:00
2026-05-29 02:24:48 -07:00
2026-05-28 02:36:09 -07:00
2026-05-21 16:40:04 +05:30
2026-05-31 03:19:37 -07:00
2026-05-07 05:10:33 -07:00
2026-05-28 22:26:25 -07:00
2026-05-08 14:27:40 -07:00
2026-04-27 08:52:12 -07:00
2026-05-28 03:34:47 -07:00
2026-05-29 12:32:35 -07:00
2026-05-25 01:20:33 -07:00
2026-05-12 01:02:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-10 13:06:25 -07:00
2026-05-28 22:26:25 -07:00
2026-04-26 18:31:07 -07:00
2026-05-28 22:26:25 -07:00
2026-05-02 02:08:06 -07:00
2026-05-15 10:36:38 +05:30
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-01 16:58:58 -07:00
2026-05-31 09:13:06 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-19 01:28:32 -07:00
2026-05-25 01:20:33 -07:00
2026-05-31 09:13:06 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 11:59:58 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 04:53:13 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-08 17:01:12 -07:00
2026-05-07 05:53:14 -07:00
2026-05-08 16:07:23 -07:00
2026-05-29 22:26:24 +05:30
2026-05-28 00:19:31 -07:00
2026-05-28 22:26:25 -07:00
2026-03-30 11:17:15 -07:00
2026-05-28 22:26:25 -07:00
2026-05-08 11:18:14 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 03:19:37 -07:00
2026-05-25 01:47:55 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-02 19:49:10 -07:00
2026-03-26 13:39:41 -07:00
2026-05-24 18:04:54 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 22:03:45 -05:00
2026-06-02 20:28:18 -04:00
2026-05-30 07:31:48 -07:00
2026-05-29 17:24:38 -07:00
2026-06-02 20:29:54 -04:00
2026-05-29 13:30:28 -07:00
2026-05-30 02:38:40 -07:00
2026-04-19 22:43:09 -07:00
2026-05-28 22:26:25 -07:00
2026-05-19 03:01:02 -07:00
2026-05-28 22:26:25 -07:00
2026-05-08 14:55:40 -07:00
2026-05-28 22:26:25 -07:00
2026-06-01 20:27:41 -07:00
2026-06-02 20:29:54 -04:00
2026-05-15 12:11:32 -07:00
2026-05-06 15:49:59 -07:00
2026-06-02 18:28:24 -05:00
2026-05-25 01:15:24 -07:00
2026-05-24 15:00:44 -07:00
2026-05-24 17:47:24 -07:00
2026-06-02 18:40:12 -05:00
2026-06-02 20:28:18 -04:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-17 12:35:01 -07:00
2026-05-24 18:12:16 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00