Conversation
teknium1
pushed a commit
that referenced
this pull request
Apr 4, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR #5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
teknium1
pushed a commit
that referenced
this pull request
Apr 5, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR #5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
Collaborator
|
Merged via PR #5147. Your path traversal guard and secret redaction fixes were cherry-picked onto current main with your authorship preserved. The absolute path restriction to HERMES_HOME was dropped as too restrictive for the feature's design intent — users may legitimately point cron scripts at paths outside ~/.hermes/. Thanks for the contribution! |
naoironman-hue
pushed a commit
to naoironman-hue/hermes-agent
that referenced
this pull request
Apr 5, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
Tommyeds
pushed a commit
to Tommyeds/hermes-agent
that referenced
this pull request
Apr 12, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
jh1nresh
pushed a commit
to jh1nresh/hermes-agent
that referenced
this pull request
Aug 26, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
…tput Relative script paths resolved against HERMES_HOME/scripts/ were not validated to stay within that directory. Paths like '../../etc/passwd' could escape and be executed as Python. Fix: resolve the path and verify it stays within scripts_dir using Path.relative_to(). Also apply redact_sensitive_text() to script stdout before LLM injection — same pattern as execute_code sandbox output. Cherry-picked from PR NousResearch#5093 by memosr (fixes 1 and 3; absolute path restriction dropped as too restrictive for the feature's design intent).
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.
What does this PR do?
The new
scriptfield added in #5082 lets cron jobs run a Python scriptbefore each turn to collect context data. Two security issues were introduced:
1. Path Traversal
Relative script paths were resolved against
HERMES_HOME/scripts/butwithout checking that the resolved path stays inside that directory:
A job with
script: "../../.hermes/auth.json"would resolve to the authstore and attempt to execute it as Python — leaking its path in the error
message, or worse if the file happened to be valid Python.
Fix: After resolving the path, verify it stays within
scripts_dirusing
Path.relative_to(). Paths that escape the directory are rejectedwith a clear error message.
2. Secret Leakage via Script Output
Script stdout is injected directly into the cron job's LLM prompt context
without redaction. If a script outputs environment variables, config values,
or any string matching a known secret pattern, those secrets flow into the
LLM context unmasked.
Fix: Apply
redact_sensitive_text()to stdout before injecting it —the same function already used for execute_code sandbox output and log
redaction.
3. Absolute Path Restriction (follow-up commit)
The initial fix only guarded relative paths. Absolute paths like
/tmp/evil.pyor/etc/passwdwere still accepted.Fix: Absolute paths are now also restricted — they must resolve
inside
HERMES_HOME. Paths outside are rejected with a clear error.Type of Change
Checklist
Path.relative_to())HERMES_HOME/scripts/