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.
sudo-yf
pushed a commit
to sudo-yf/hermes-agent
that referenced
this pull request
Apr 5, 2026
Adds a server-side boolean setting (default: false) that controls whether CLI sessions from state.db appear in the sidebar. Off by default so the sidebar is clean until the user explicitly opts in. - api/config.py: add show_cli_sessions to _SETTINGS_DEFAULTS and _SETTINGS_BOOL_KEYS - api/routes.py: gate get_cli_sessions() call on the setting at request time - static/index.html: checkbox in settings panel with description - static/panels.js: load/save checkbox, refresh session list on save - static/boot.js: load on startup alongside send_key and show_token_usage Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
sudo-yf
pushed a commit
to sudo-yf/hermes-agent
that referenced
this pull request
Apr 5, 2026
CHANGELOG: add v0.30.1 entry covering PRs NousResearch#57-NousResearch#61 (CLI session bridge fixes: sidebar rendering, profile-aware state.db path, silent SQL error, show/hide toggle in Settings. README: add CLI session bridge, token/cost display, subagent cards, /usage command, skills linked files, show CLI sessions toggle. Version label: v0.30 -> v0.30.1 in index.html, SPRINTS, CHANGELOG footer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> EOF )
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
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 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.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
…ymlink fix: resolve symlink bypass in write deny list on macOS
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 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.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ymlink fix: resolve symlink bypass in write deny list on macOS
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