You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(security): v0.7.1 SSRF guard with redirect re-validation + credential-dir denylist
Closes two MEDIUM findings from the 2026-05-11 semantic follow-up audit.
F-NEW-2 — Web ingest SSRF guard (`memboot ingest <url>`):
- Fetch moved off `trafilatura.fetch_url` to a stdlib `urllib` GET so the
redirect chain is under our control.
- `_validate_ingest_url` runs on the initial URL; `_ValidatingRedirectHandler`
re-runs the same guard on every redirect hop, so a public URL can't 30x-bounce
to 169.254.169.254 / RFC1918 / loopback.
- Only http(s) schemes accepted. Multi-record DNS: any non-public address in the
set rejects the URL.
- Redirects capped at 5, body at 10 MiB (compression refused), 20 s timeout.
- `MEMBOOT_INGEST_ALLOW_PRIVATE=1` overrides the IP check; the scheme check is
always enforced. `trafilatura.extract` still does extraction.
- Residual: DNS rebinding within a single fetch — out of scope for the
single-user-CLI threat model.
- Bare `except Exception` narrowed to `(OSError, ValueError)` (F-NEW-6).
F-NEW-1 — Credential-directory denylist in default `ignore_patterns`:
- Adds .env / .env.* / *.env, .aws, .ssh, .gnupg, .netrc, .docker, .kube,
.gcloud, .azure, .terraform, secrets, secret, credentials, plus the file
patterns *.pem, *.key, id_rsa*, id_ed25519*, *.p12, *.pfx, *.tfvars,
*.tfvars.json.
- Poka-yoke regression test in tests/test_indexer.py constructs a temp project
with these surfaces and asserts none reach `discover_files` output.
Tests: 649 passed (was 621), 90.9% coverage.
Deps:
- urllib3>=2.7.0 pinned (CVE-2026-44431, CVE-2026-44432).
Version bump: 0.7.0 → 0.7.1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments