fix: resolve symlink bypass in write deny list on macOS - #61
Merged
Conversation
On macOS, /etc is a symlink to /private/etc. The _is_write_denied()
function resolves the input path with os.path.realpath() but the deny
list entries were stored as literal strings ("/etc/shadow"). This meant
the resolved path "/private/etc/shadow" never matched, allowing writes
to sensitive system files on macOS.
Fix: Apply os.path.realpath() to deny list entries at module load time
so both sides of the comparison use resolved paths.
Adds 19 regression tests in tests/tools/test_write_deny.py.
0xbyt4
added a commit
to 0xbyt4/hermes-agent
that referenced
this pull request
Feb 26, 2026
These tests documented the macOS symlink bypass bug with platform-conditional assertions. The fix and proper regression tests are in PR NousResearch#61 (tests/tools/test_write_deny.py), so remove them here to avoid ordering conflicts between the two PRs.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
These tests documented the macOS symlink bypass bug with platform-conditional assertions. The fix and proper regression tests are in PR NousResearch#61 (tests/tools/test_write_deny.py), so remove them here to avoid ordering conflicts between the two PRs.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…ymlink fix: resolve symlink bypass in write deny list on macOS
dizhaky
referenced
this pull request
in dizhaky/hermes-agent
Jun 23, 2026
…AN-1385) (#26) baileys 7.0.0-rc.9->rc13 (clears #43 critical) + protobufjs 7.6.4 (#59,#58) in whatsapp-bridge; esbuild+tsx (#46,#61) in ui-tui; @babel/core (#84) in web; joi+http-proxy-middleware (#51,#89) in website. js-yaml #86 accepted (no in-range fix via gray-matter). Bridge startup verified. #93/#94 (code fixes) separate. Co-Authored-By: Claude <noreply@anthropic.com>
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
These tests documented the macOS symlink bypass bug with platform-conditional assertions. The fix and proper regression tests are in PR NousResearch#61 (tests/tools/test_write_deny.py), so remove them here to avoid ordering conflicts between the two PRs.
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…ymlink fix: resolve symlink bypass in write deny list on macOS
nlachica
added a commit
to Ahlnos-Inc/hermes-agent
that referenced
this pull request
Jul 11, 2026
…ve failover Full CI-parity gate: branch 38199 passed/36 failed == clean-main baseline 36 failed (identical 14 pre-existing host-state files). Review: orchestrator + 2 rounds cross-family Sol xhigh, all findings fixed or rebutted (record on BUILD-392 + hermes-config PR NousResearch#61). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Meraniya
pushed a commit
to Meraniya/hermes-agent
that referenced
this pull request
Aug 6, 2026
…esearch#61) Workflow declares on: pull_request only, but was showing workflow-level failures (zero jobs run, conclusion=failure) triggered by push events to main (event=push, pull_requests=[]) — 6/6 recent runs failing. Root cause: concurrency.group referenced ${{ github.event.pull_request.number }}, which is null on a push event. An unresolvable expression in concurrency.group appears to produce a workflow-level config failure rather than a clean skip. Fix: - concurrency.group falls back to github.sha when pull_request.number is unset, so the expression always resolves. - job-level if: now checks github.event_name == 'pull_request' first, short-circuiting before touching github.event.pull_request on other event types. Discovered via 2026-06-30 daily-repo-scan (DAN-1639). Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Soju06
added a commit
to Soju06/hermes-agent
that referenced
this pull request
Aug 13, 2026
choi138
added a commit
to choi138/hermes-agent
that referenced
this pull request
Aug 18, 2026
choi138
added a commit
to choi138/hermes-agent
that referenced
this pull request
Aug 18, 2026
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.
Summary
_is_write_denied()was bypassed on macOS for all/etc/*paths/etcis a symlink to/private/etc. The function resolved the input path withos.path.realpath()but deny list entries were stored as literal strings (/etc/shadow), so the resolved path/private/etc/shadownever matched.os.path.realpath()to deny list entries at module load time so both sides use resolved pathsAffected paths (were unprotected on macOS)
/etc/shadow,/etc/passwd,/etc/sudoers/etc/sudoers.d/*,/etc/systemd/*Test plan
tests/tools/test_write_deny.py— all passing on macOS