Summary
Hermes-agent up to 2026.4.16 contains a missing authorization issue in the check_all_command_guards function of tools/approval.py, within the Batch Runner component.
A remote attacker can potentially invoke or bypass command guard logic without proper permission checks, enabling unauthorized actions once they can reach the affected interface.
Affected context
The vulnerability arises in deployments of hermes-agent that expose the Batch Runner functionality, either directly or via an API or orchestration layer.
Specifically, the check_all_command_guards function in tools/approval.py is responsible for enforcing guard or approval checks on batch commands but does not reliably verify the actor's authorization.
Where hermes-agent is used to automate or orchestrate commands, tasks, or tool invocations on behalf of users, this missing authorization logic becomes risky because it assumes that callers are trusted or already vetted.
Exploit preconditions
- Attack surface: Remote interface to hermes-agent's Batch Runner (e.g., HTTP API, RPC endpoint, or other network-accessible integration point).
- Required access: Network-level access to the hermes-agent instance; no valid user identity or elevated role is necessarily required if the batch-triggering interface is exposed.
- Trigger point: Invocation of batch operations or commands that rely on
check_all_command_guardsto enforce approvals or guardrails. - Why exploitation is possible: The guard-checking function either omits authorization checks, performs them incompletely, or assumes trust in caller context, allowing an attacker to trigger guarded commands without appropriate permissions.
Why this happens
This vulnerability is a classic case of missing authorization (CWE-862) combined with aspects of improper authorization (CWE-863).
The check_all_command_guards function appears to validate that commands meet certain guard or approval criteria, but it does not robustly confirm that the caller is authorized to execute those commands or bypass safeguards.
At an abstract level, the code couples enforcement to the presence of guard configuration rather than to a clear access-control decision tied to an authenticated principal and a defined privilege model.
As a result, the system treats potentially untrusted requests as if they are allowed to bypass or satisfy guard requirements, leading to unauthorized operations.
Potential impact
- Execution of commands or batch tasks without the intended approval or review.
- Unauthorized use of tools or integrations that hermes-agent can access (e.g., file systems, APIs, CI/CD tasks, infrastructure actions).
- Privilege abuse where low-privilege users or anonymous callers can trigger high-impact operations.
- Lateral movement or environment manipulation if the agent orchestrates actions in other systems.
- Integrity and availability impacts on downstream systems controlled or automated by the Batch Runner.
General mitigation guidance
Mitigation focuses on establishing explicit, enforceable authorization boundaries around batch execution and command guards:
- Introduce a clear access-control layer that evaluates every incoming batch or command request against an authenticated identity and role, independent of guard configuration.
- Model permissions explicitly (e.g., per-command, per-tool, or per-resource scopes) and ensure
check_all_command_guardsconsults this model rather than assuming trust. - Apply the principle of least privilege by limiting which accounts or services can reach the Batch Runner interface and what actions they can perform.
- Treat guard and approval mechanisms as additional defense-in-depth, not as a replacement for proper authorization.
- When designing new tools or commands for hermes-agent, define required permissions and ensure they are enforced before any action is executed.
How teams detect issues like this
Detection typically targets weak or missing access-control paths:
- Static analysis: Search for calls to
check_all_command_guardsand related execution paths where no prior authorization check is performed, or where authorization results are not enforced. - Code review signals: Look for functions that:
- Accept remote input and trigger actions but do not reference authentication/authorization components.
- Use comments like "TODO auth" or "trusted environment only" as a justification for skipping checks.
- Rely solely on configuration flags or guard lists without tying them to user identity or roles.
- Policy enforcement: Use security review checklists that require explicit authorization around any command execution or automation entrypoint.
- Runtime monitoring: Correlate logs of batch executions with caller identity; flag executions lacking an associated authenticated principal or occurring from unexpected sources.
- Automated application security testing tools can be configured to probe exposed Batch Runner endpoints and verify that unauthorized requests cannot trigger guarded actions.

