Skip to content

fix(osint-autopilot): validate domain arg to prevent path traversal - #14

Merged
elementalsouls merged 1 commit into
elementalsouls:mainfrom
xiaolai:fix/recon-pipeline-domain-validation
Aug 10, 2026
Merged

fix(osint-autopilot): validate domain arg to prevent path traversal#14
elementalsouls merged 1 commit into
elementalsouls:mainfrom
xiaolai:fix/recon-pipeline-domain-validation

Conversation

@xiaolai

@xiaolai xiaolai commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Automated: drive-by fix from NLPM, an NL artifact linter. Reviewed and reproduced before submission.

Bug: recon_pipeline.sh builds ENG="$HOME/Research/engagements/$D" from the unsanitized domain argument, so a value containing ../ escapes the intended engagement directory.

Evidence: D="../../../tmp/pwned" resolves $ENG to a path under /tmp/tmp/pwned instead of ~/Research/engagements/ — reproduced locally with mkdir -p "$ENG"/{...} actually creating files outside the intended tree.

Fix: Reject any domain argument outside [A-Za-z0-9.-] before $ENG is constructed.

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
elementalsouls merged commit ad89bff into elementalsouls:main Aug 10, 2026
2 of 4 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants