Skip to content

fix(exec_policy): judge every hop of a symlink chain (Ubuntu 26.04 rm -> gnurm) - #10

Merged
quantum-osiris merged 1 commit into
mainfrom
bugfix/exec-policy-symlink-chain
Nov 10, 2026
Merged

quantum-osiris merged 1 commit into
mainfrom
bugfix/exec-policy-symlink-chain

Conversation

@quantum-osiris

Copy link
Copy Markdown
Owner

Security fix

On Ubuntu 26.04, /usr/bin/rm is a symlink to gnurm. classify() judged a program only by the final file a link resolves to. gnurm is not a known name and sits in a system directory, so the policy treated it as a harmless distribution alternative and skipped it. The command was then classified by the link's name instead.

Result before this fix: a symlink ./ls -> /usr/bin/rm let an agent-origin ./ls -rf x through as ALLOW. Expected: DENY / MUTATE.

Change

  • Every hop of the symlink chain is judged (ls -> rm -> gnurm), not only the last one.
  • A gnu<name> hop is also judged as <name>.
  • The existing exception still applies: an unknown name in a system directory (for example which -> which.debianutils) is not treated as a risk.

Tests

  • Two new portable tests build the chain under a temporary directory that is patched into _SYSTEM_DIRS, so they don't depend on the host OS.
  • Without the fix, all three symlink tests fail (the existing one plus the two new ones). With it, they pass.
  • TestGitHubBridge::test_auth_status_inspection no longer hardcodes osiris-dnalang. It now checks only that gh reports an account; the account became quantum-osiris on 2026-11-09.
  • Full suite: 1796 passed, 13 skipped, 0 failed. ruff check --select E,F,W on the changed files: clean.

Together with #9, this clears the two failures that were already on main.

🤖 Generated with Claude Code

…ame>

On Ubuntu 26.04 /usr/bin/rm -> gnurm. classify() judged only the final
target name; "gnurm" is unknown and lives in a system dir, so it was
treated as a distribution alternative and ignored, and ./ls -> /usr/bin/rm
was classified by its link name: an agent-origin `./ls -rf x` was ALLOWed.

Now every hop of the chain is judged (ls -> rm -> gnurm), and a gnu<name>
hop is also judged as <name>. Two portable tests build the chain under a
temp dir patched into _SYSTEM_DIRS; all three link tests fail without the
fix.

Also: the GitHubBridge auth test asserted the account name "osiris-dnalang";
it now checks only that an account is reported (the gh account changed to
quantum-osiris on 2026-11-09). Drops an unused MagicMock import.

Full suite: 1796 passed, 13 skipped, 0 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quantum-osiris
quantum-osiris merged commit bd78cc2 into main Nov 10, 2026
10 checks passed
@quantum-osiris
quantum-osiris deleted the bugfix/exec-policy-symlink-chain branch November 10, 2026 05:08
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.

1 participant