fix(osint-autopilot): validate domain arg to prevent path traversal - #14
Merged
elementalsouls merged 1 commit intoAug 10, 2026
Conversation
recon_pipeline.sh built ENG="$HOME/Research/engagements/$D" directly from the unsanitized domain argument. A value containing "../" walked the resulting path outside the intended engagement tree (verified: D="../../../tmp/pwned" resolved to a directory under /tmp/tmp instead of ~/Research/engagements/). Reject any argument outside [A-Za-z0-9.-] before the path is constructed. Co-Authored-By: Claude Code <noreply@anthropic.com>
4 tasks
elementalsouls
added a commit
that referenced
this pull request
Aug 10, 2026
…ee entry points (#16) Follow-up to #14. That guard blocked separators but still admitted: - `.` and `..`, which match `[A-Za-z0-9.-]+`. `recon_pipeline.sh ..` resolves ENG to `~/Research` and `mkdir -p` scatters the evidence tree there. - a leading `-`, which reaches `whois "$D"` and `gau ... "$D"` as an option rather than an operand. It also only covered the shell driver. `findings_gen.py` and `build_xlsx.py` build the same `~/Research/engagements/{D}` path from the same unvalidated argv[1] and had no check at all — verified by removing the new guard and watching findings_gen.py write to `engagements/../../tmp/pwned/findings/findings.csv`. Replaces the character class with a full dotted-hostname match and applies it at all three entry points. `test_domain_guard.sh` asserts on the guard's own error string (not merely a non-zero exit, which any unrelated failure would satisfy), runs no network, and sandboxes $HOME. Co-authored-by: Sachin Sharma <elementalsoul@Sachins-MacBook-Pro.local> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
elementalsouls
pushed a commit
that referenced
this pull request
Aug 11, 2026
) recon_pipeline.sh built ENG="$HOME/Research/engagements/$D" directly from the unsanitized domain argument. A value containing "../" walked the resulting path outside the intended engagement tree (verified: D="../../../tmp/pwned" resolved to a directory under /tmp/tmp instead of ~/Research/engagements/). Reject any argument outside [A-Za-z0-9.-] before the path is constructed. Co-authored-by: Claude Code <noreply@anthropic.com>
elementalsouls
added a commit
that referenced
this pull request
Aug 11, 2026
…ee entry points (#16) Follow-up to #14. That guard blocked separators but still admitted: - `.` and `..`, which match `[A-Za-z0-9.-]+`. `recon_pipeline.sh ..` resolves ENG to `~/Research` and `mkdir -p` scatters the evidence tree there. - a leading `-`, which reaches `whois "$D"` and `gau ... "$D"` as an option rather than an operand. It also only covered the shell driver. `findings_gen.py` and `build_xlsx.py` build the same `~/Research/engagements/{D}` path from the same unvalidated argv[1] and had no check at all — verified by removing the new guard and watching findings_gen.py write to `engagements/../../tmp/pwned/findings/findings.csv`. Replaces the character class with a full dotted-hostname match and applies it at all three entry points. `test_domain_guard.sh` asserts on the guard's own error string (not merely a non-zero exit, which any unrelated failure would satisfy), runs no network, and sandboxes $HOME. Co-authored-by: Sachin Sharma <elementalsoul@Sachins-MacBook-Pro.local> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Bug:
recon_pipeline.shbuildsENG="$HOME/Research/engagements/$D"from the unsanitized domain argument, so a value containing../escapes the intended engagement directory.Evidence:
D="../../../tmp/pwned"resolves$ENGto a path under/tmp/tmp/pwnedinstead of~/Research/engagements/— reproduced locally withmkdir -p "$ENG"/{...}actually creating files outside the intended tree.Fix: Reject any domain argument outside
[A-Za-z0-9.-]before$ENGis constructed.