fix(telegram): try 5dive unprivileged before sudo, and stop after one denial (DIVE-4397) - #65
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'ssudoers grant is scoped, so the call is denied and sudo mails root about it, and
reconcileNeedsBannerruns one on a 60s timer. One mail per scoped seat perminute, forever; the reader's own catch swallowed the rejection so nothing on our
side ever reported it.
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
spawned for the life of the process, so the worst case is one mail per start
latch — an over-eager latch would silently strip root from admin seats
an hour: a swallowed catch on a 60s timer is what cost 39 days here
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