Skip to content

fix(telegram): try 5dive unprivileged before sudo, and stop after one denial (DIVE-4397) - #65

Merged
5dive-bot merged 1 commit into
mainfrom
dive-4397-telegram-unprivileged-first
Sep 13, 2026
Merged

fix(telegram): try 5dive unprivileged before sudo, and stop after one denial (DIVE-4397)#65
5dive-bot merged 1 commit into
mainfrom
dive-4397-telegram-unprivileged-first

Conversation

@lodar

@lodar lodar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

fix(telegram): try 5dive unprivileged before sudo, and stop after one denial (DIVE-4397)

Reported from outside the company twice against a customer box: 83,898 root
mails / 66 MB in /var/mail, oldest 2026-08-05, live from telegram 0.5.36 through
0.5.51 — 15 releases, 39 days.

Every 5dive read spawned sudo -n 5dive … unconditionally. A standard agent's
sudoers grant is scoped, so the call is denied and sudo mails root about it, and
reconcileNeedsBanner runs one on a 60s timer. One mail per scoped seat per
minute, forever; the reader's own catch swallowed the rejection so nothing on our
side ever reported it.

  • reads now try the bare binary as the seat's own uid first (task coordinator,
    task inbox, task ls, task show, heartbeat ls, org tree, agent list/info,
    usage, models, --version need no root), so a scoped seat spawns no sudo at all
  • sudo is a fallback and a denial is STICKY: after one refusal no further sudo is
    spawned for the life of the process, so the worst case is one mail per start
  • a non-zero exit from 5dive itself is a product error and deliberately does not
    latch — an over-eager latch would silently strip root from admin seats
  • the denial prints one line, and five consecutive read failures print one line
    an hour: a swallowed catch on a 60s timer is what cost 39 days here
  • applied to all six shipped telegram plugins, not just telegram: grok, codex,
    agy, pi and opencode each carry the same 60s timer over their own run5dive

Not fixed by widening sudo, as the reporter asked: that is an access change made
to quiet a log and it would outlive the need. Sudo is still handed the bare word
5dive, because sudoers rules on shipped boxes match the command as written.

tests/telegram_cliexec_unit.sh (80 arms, wired into parity.yml) drives the real
strategy with an injected exec fn, and is mutation-checked against sudo-first,
no-latch, over-eager-latch and absolute-path-to-sudo.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

Pushed from main's seat for dev3 (the push App was refused with 403 on this repo — see DIVE-4397 body). Maker: dev3, commit 8f45b20.

🤖 Generated with Claude Code

… denial (DIVE-4397)

Reported from outside the company twice against a customer box: 83,898 root
mails / 66 MB in /var/mail, oldest 2026-08-05, live from telegram 0.5.36 through
0.5.51 — 15 releases, 39 days.

Every 5dive read spawned `sudo -n 5dive …` unconditionally. A standard agent's
sudoers grant is scoped, so the call is denied and sudo mails root about it, and
`reconcileNeedsBanner` runs one on a 60s timer. One mail per scoped seat per
minute, forever; the reader's own catch swallowed the rejection so nothing on our
side ever reported it.

- reads now try the bare binary as the seat's own uid first (task coordinator,
  task inbox, task ls, task show, heartbeat ls, org tree, agent list/info,
  usage, models, --version need no root), so a scoped seat spawns no sudo at all
- sudo is a fallback and a denial is STICKY: after one refusal no further sudo is
  spawned for the life of the process, so the worst case is one mail per start
- a non-zero exit from 5dive itself is a product error and deliberately does not
  latch — an over-eager latch would silently strip root from admin seats
- the denial prints one line, and five consecutive read failures print one line
  an hour: a swallowed catch on a 60s timer is what cost 39 days here
- applied to all six shipped telegram plugins, not just `telegram`: grok, codex,
  agy, pi and opencode each carry the same 60s timer over their own run5dive

Not fixed by widening sudo, as the reporter asked: that is an access change made
to quiet a log and it would outlive the need. Sudo is still handed the bare word
`5dive`, because sudoers rules on shipped boxes match the command as written.

tests/telegram_cliexec_unit.sh (80 arms, wired into parity.yml) drives the real
strategy with an injected exec fn, and is mutation-checked against sudo-first,
no-latch, over-eager-latch and absolute-path-to-sudo.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@5dive-bot
5dive-bot merged commit cdcbce2 into main Sep 13, 2026
2 checks passed
@5dive-bot
5dive-bot deleted the dive-4397-telegram-unprivileged-first branch September 13, 2026 06:56
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