fix(approval): close gateway lifecycle bypass gaps (fixes #33071) - #33562
Closed
zccyman wants to merge 1 commit into
Closed
fix(approval): close gateway lifecycle bypass gaps (fixes #33071)#33562zccyman wants to merge 1 commit into
zccyman wants to merge 1 commit into
Conversation
…h#33071) Close regex gaps that allowed stopping/restarting the Hermes gateway without going through the dangerous-command approval gate: - pkill -f hermes_cli (full -f command-line pattern matching) - kill $(pidof hermes_cli.main) (pidof substitution variants) - systemctl --user stop/restart hermes-gateway (user systemd) - systemctl stop hermes-gateway (system systemd) - launchctl stop/kickstart ai.hermes.gateway (macOS launchd) Note: direct `kill -TERM <pid>` with a concrete PID obtained via ps/pgrep is still not capturable by regex (PID is opaque to pattern matching). Full mitigation requires transport-level or API-level guard (tracked in NousResearch#32877).
19 tasks
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
Fixes #33071
Problem
The dangerous-command approval gate protected
hermes gateway restartbut allowed equivalent effects through bypass paths:pkill -fpatternpkill -f 'hermes.*gateway'pkill -funquotedpkill -f hermes_clipkill -funquotedpkill -f gateway_runpidofsubstitutionkill $(pidof hermes_cli.main)pidofsubstitutionkill $(pidof gateway)systemctl --usersystemctl --user stop hermes-gatewaylaunchctllaunchctl stop ai.hermes.gatewaylaunchctl kickstart -klaunchctl kickstart -k gui/$(id -u)/ai.hermes.gatewayFix
Added 8 new patterns to
HARDLINE_PATTERNSintools/approval.py:Read-only commands remain unblocked:
systemctl --user status hermes-gatewaylaunchctl print gui/.../ai.hermes.gatewaypgrep -f hermesScope note
Direct
kill -TERM <pid>where the agent obtains the PID viaps/pgrepand passes a concrete number is not capturable by regex (the PID itself is opaque to pattern matching). Full mitigation requires transport-level or API-level guard — tracked in #32877.Testing