Files
25b80c581a harden #15 fixes: real path containment + fix heredoc backtick regression
Builds on @sseshachala's security fixes (#15 / closes #13). Triage found two
defects in those fixes, corrected here:

1. Path containment was `str(resolved).startswith(str(safe))` in both cmd_recon
   and --out — bypassable by a sibling sharing the prefix (recon ⊂ recon-evil,
   <cwd> ⊂ <cwd>-evil). Replaced with a real ancestry test
   (`resolved == safe or safe in resolved.parents`). Verified: ../recon-evil/x
   and ../<cwd>-evil/x.md now rejected; valid targets accepted.

2. hunt.sh switched the scaffold heredocs to quoted (<<'EOF') to kill the
   $target injection (good), but left the old `\`` backslash-escapes that were
   only needed under the *unquoted* heredoc — under a quoted heredoc they were
   written literally, corrupting every generated CLAUDE.md/scope.md/etc.
   De-escaped all `\`` → ` inside the quoted bodies. Verified: backticks render,
   injection still neutralized ($(id) written literally, not executed).

Bug 5 (TLS CERT_NONE under --proxy) retains #15's loud warning rather than a
hard --insecure gate, since disabling verification is inherent to routing
through Burp's self-signed CA — gating it would break the primary workflow.

Co-Authored-By: Sudhi Seshachala <sseshachala@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 21:30:29 +05:30
..