fix(osint-autopilot): close remaining domain-arg traversal at all three entry points - #16
Merged
Merged
Conversation
elementalsouls
force-pushed
the
harden/domain-validation
branch
from
August 10, 2026 20:38
5a6210d to
504b1d5
Compare
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.
Follow-up to #14 — stacked on top of it (branched from that PR's head, so the diff here includes it). Merge #14 first and this rebases clean; or merge this alone and #14 is subsumed.
#14's guard is the right idea in the right place (before
ENG=is built, beforemkdir -p), but it leaves the hole open in two ways and covers one of three entry points.1.
.and..still pass^[A-Za-z0-9.-]+$matches them:mkdir -p "$ENG"/{evidence/{...},assets,findings,notes,buckets}then scatters the whole evidence tree into~/Research. A leading-also passes (-rf,--help), reachingwhois "$D"(recon_pipeline.sh:26) andgau --subs --threads 5 "$D"(:82) as an option rather than an operand.2. Two of three entry points had no guard at all
Both Python scripts build the same path from the same unvalidated
sys.argv[1]:findings_gen.py:7—ENG = os.path.expanduser(f"~/Research/engagements/{D}")build_xlsx.py:10— identical, plusOUT = f"{ENG}/{D}-osint-consolidated.xlsx"Verified by removing the new guard and re-running the self-check:
Fix
Full dotted-hostname match, applied at all three entry points:
Requires at least one label separator, so
./../nodotare out; forbids leading/trailing-per label, so option injection is out.example..com,example.com., andexample.com;idare rejected too.Check
scripts/test_domain_guard.sh— no network,$HOMEsandboxed to a temp dir:It asserts on the guard's own
invalid domainstring rather than a non-zero exit, so a script failing for an unrelated reason can't make it pass vacuously — confirmed by deleting a guard and watching it fail (output above). It also asserts the sandbox is empty afterward, and that a real domain still passes.Note, not fixed here
.github/workflows/lint.ymlpins shellcheck toscandir: ./scripts, so the scripts underskills/*/scripts/— including the one this PR adds — are never linted. Fixed separately in #17. (An earlier revision of this description said that path doesn't exist; it does, it just holds one file.)🤖 Generated with Claude Code