Skip to content

fix: resolve symlink bypass in write deny list on macOS - #61

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/write-deny-macos-symlink
Feb 27, 2026
Merged

fix: resolve symlink bypass in write deny list on macOS#61
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/write-deny-macos-symlink

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • _is_write_denied() was bypassed on macOS for all /etc/* paths
  • On macOS, /etc is a symlink to /private/etc. The function resolved the input path with os.path.realpath() but deny list entries were stored as literal strings (/etc/shadow), so the resolved path /private/etc/shadow never matched.
  • Fix: Apply os.path.realpath() to deny list entries at module load time so both sides use resolved paths

Affected paths (were unprotected on macOS)

  • /etc/shadow, /etc/passwd, /etc/sudoers
  • /etc/sudoers.d/*, /etc/systemd/*

Test plan

  • 19 regression tests in tests/tools/test_write_deny.py — all passing on macOS
  • Verified fix with inline Python check for all 7 affected paths

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.
@teknium1
teknium1 merged commit 0909be3 into NousResearch:main Feb 27, 2026
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
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