teknium1
624580e836
fix(browser): verify daemon identity before orphan reaper kills a PID ( #14073 )
...
The browser orphan reaper reads a daemon PID from a `.pid` file in a
world-writable, predictably-named temp dir (`/tmp/agent-browser-h_*`) it
does not write itself, then tree-kills that PID via `_terminate_host_pid`
after only a liveness check. A same-user actor could plant a fake socket
dir whose `.pid` points at an arbitrary victim process, and OS PID reuse
after the real daemon exits could land the recorded PID on an unrelated
process — either way an arbitrary same-user process (and its whole tree)
gets SIGTERMed. Local DoS.
Add `_verify_reapable_browser_daemon()`, gated before the kill: via psutil
(a hard dep, fine cross-platform for the same-user processes the reaper can
signal) require both (1) identity — `agent-browser` in the process
name/cmdline — and (2) binding — the live process references *this* session's
socket dir in its cmdline or `AGENT_BROWSER_SOCKET_DIR`. The binding check is
the real spoof defense: a planted/recycled PID won't embed our exact socket
path. Fail-closed on any ambiguity (unreadable cmdline, no match), leaving the
process and its socket dir untouched for a later sweep.
Builds on @sgaofen's fix in #14394 (cmdline identity check); rewritten to use
psutil instead of `/proc`+`ps` (cross-platform, Windows-covered) and to add
the session-socket-dir binding check for recycled-PID / spoof resistance.
Co-authored-by: sgaofen <135070653+sgaofen@users.noreply.github.com >
2026-06-21 15:23:47 -07:00
..
2026-05-22 03:33:01 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 13:33:48 -07:00
2026-05-28 22:26:25 -07:00
2026-06-13 14:35:27 -07:00
2026-06-20 11:27:12 -07:00
2026-05-28 22:26:25 -07:00
2026-06-11 10:49:47 -07:00
2026-05-12 15:14:49 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 15:43:55 +10:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 13:35:39 -07:00
2026-05-29 03:58:56 -07:00
2026-05-28 22:26:25 -07:00
2026-05-30 07:31:25 -07:00
2026-06-15 07:46:34 -07:00
2026-05-28 22:26:25 -07:00
2026-05-06 03:41:21 -07:00
2026-06-21 15:23:47 -07:00
2026-06-07 11:42:26 -06:00
2026-06-21 07:26:18 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 17:46:38 +05:30
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 06:31:08 -07:00
2026-05-28 22:26:25 -07:00
2026-05-17 02:29:41 -07:00
2026-05-29 03:44:49 -07:00
2026-06-13 21:57:15 -07:00
2026-06-18 12:48:36 +10:00
2026-06-09 23:21:24 -07:00
2026-06-07 02:09:20 -07:00
2026-06-18 08:53:31 -07:00
2026-05-28 22:26:25 -07:00
2026-06-13 03:33:27 -07:00
2026-05-08 14:55:40 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 13:28:04 +05:30
2026-06-10 14:39:03 -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-06-16 14:30:11 -04:00
2026-05-28 22:26:25 -07:00
2026-06-16 14:30:11 -04:00
2026-05-28 22:26:25 -07:00
2026-06-06 18:43:20 -07:00
2026-06-08 22:46:57 -07:00
2026-05-29 11:49:54 +10:00
2026-06-18 14:14:41 +10:00
2026-06-18 09:09:21 +10:00
2026-06-10 19:23:06 +10:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:09 -07:00
2026-06-04 19:40:30 -07:00
2026-05-30 07:01:22 -07:00
2026-06-17 13:45:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 12:16:10 -07:00
2026-05-28 22:26:25 -07:00
2026-06-15 14:00:42 +05:30
2026-06-15 14:00:42 +05:30
2026-05-28 22:26:25 -07:00
2026-06-21 11:55:59 -07:00
2026-05-30 06:25:50 -07:00
2026-05-28 03:27:20 -07:00
2026-06-01 16:55:04 -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-21 16:40:04 +05:30
2026-06-18 22:13:07 -07:00
2026-05-15 01:33:13 -07:00
2026-06-19 16:59:54 -07:00
2026-06-18 22:13:07 -07:00
2026-05-30 07:28:11 -07:00
2026-06-21 12:02:30 -07:00
2026-06-18 14:10:51 -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-06-09 02:21:12 -07:00
2026-05-04 15:31:47 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-11 19:50:08 -05:00
2026-06-07 03:57:21 -07:00
2026-05-29 22:26:24 +05:30
2026-05-28 22:26:25 -07:00
2026-05-30 07:58:08 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 16:02:56 +05:30
2026-05-28 22:26:25 -07:00
2026-06-19 11:46:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-16 13:06:56 -07:00
2026-06-11 04:37:01 -07:00
2026-06-15 04:22:07 -07:00
2026-06-15 04:22:07 -07:00
2026-05-07 05:35:33 -07:00
2026-06-15 04:22:07 -07:00
2026-06-01 19:49:50 -07:00
2026-06-14 02:09:45 -07:00
2026-05-07 07:08:04 -07:00
2026-06-14 02:09:45 -07:00
2026-05-15 14:00:01 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-17 07:11:23 -07:00
2026-05-28 22:26:25 -07:00
2026-06-18 10:19:33 -07:00
2026-06-20 23:46:52 -07:00
2026-05-08 09:27:26 -07:00
2026-05-08 09:27:26 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 00:43:32 -07:00
2026-06-21 11:11:23 -07:00
2026-06-06 18:30:39 -07:00
2026-05-25 15:18:45 -07:00
2026-05-20 01:46:40 -05:00
2026-05-25 06:13:36 -07:00
2026-06-15 07:08:24 -07:00
2026-06-13 14:42:51 -07:00
2026-06-17 13:45:25 -07:00
2026-06-19 11:57:43 -07:00
2026-05-13 17:32:22 -07:00
2026-05-28 22:26:25 -07:00
2026-06-12 00:30:51 -05:00
2026-06-13 14:35:21 -07:00
2026-06-20 23:23:47 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 10:26:45 -07:00
2026-06-12 01:07:38 -07:00
2026-06-15 05:51:47 -07:00
2026-05-18 22:19:50 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 23:23:47 -07:00
2026-06-07 23:04:54 -07:00
2026-06-20 10:26:45 -07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-15 17:14:59 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-17 06:04:03 -07:00
2026-06-06 18:29:52 -07:00
2026-05-28 22:26:25 -07:00
2026-06-01 01:58:48 -07:00
2026-05-19 14:17:38 -07:00
2026-06-11 18:03:11 -04:00
2026-06-09 23:22:54 -07:00
2026-06-18 12:26:20 +05:30
2026-06-18 08:53:35 -07:00
2026-06-16 13:08:34 -07:00
2026-06-20 23:23:47 -07:00
2026-06-04 18:06:21 -07:00
2026-06-03 15:11:15 +10:00
2026-06-18 09:09:21 +10:00
2026-06-18 14:14:41 +10:00
2026-06-15 13:47:05 +10:00
2026-06-04 11:11:27 +10:00
2026-06-01 14:38:08 +10:00
2026-06-04 12:38:24 +10:00
2026-06-04 10:51:51 +10:00
2026-06-08 22:46:57 -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-06-09 02:11:46 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-04 23:39:34 -07:00
2026-05-27 00:43:32 -07:00
2026-06-11 19:50:08 -05:00
2026-05-25 14:52:24 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 18:06:27 -07:00
2026-05-29 13:35:39 +10:00
2026-05-31 00:50:19 -07:00
2026-05-28 22:26:25 -07:00
2026-06-03 06:36:46 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 17:46:56 -05:00
2026-05-25 01:41:19 -07:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-15 12:11:32 -07:00
2026-06-10 02:57:39 -07:00
2026-05-13 17:32:22 -07:00
2026-06-10 02:57:39 -07:00
2026-05-29 13:24:12 -07:00
2026-05-18 22:29:45 -07:00
2026-05-25 05:15:55 -07:00
2026-06-19 07:04:58 -07:00
2026-05-24 18:04:54 -07:00
2026-05-13 22:04:28 -07:00
2026-06-19 07:26:56 -07:00
2026-06-21 13:56:35 -07:00
2026-05-28 22:26:25 -07:00
2026-05-13 16:39:41 -07:00
2026-05-13 16:39:41 -07:00
2026-06-01 19:00:30 -07:00
2026-05-31 00:12:09 -07:00
2026-06-04 18:04:47 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 00:11:52 -07:00
2026-05-28 22:26:25 -07:00
2026-06-04 18:04:47 -07:00
2026-06-14 16:47:57 -07:00
2026-06-14 16:47:57 -07:00
2026-05-28 04:52:42 -07:00
2026-06-14 16:47:57 -07:00
2026-06-14 16:47:57 -07:00
2026-05-28 04:52:42 -07:00
2026-06-04 18:04:47 -07:00
2026-06-20 10:26:45 -07:00
2026-06-10 02:57:15 -07:00
2026-06-14 02:07:32 -07:00
2026-05-21 02:38:45 +05:30
2026-05-25 03:35:33 -07:00
2026-06-21 11:35:09 -07:00