Skip to content

fix: memory-ingest fetch/read boundary hardening (iss-30 subset) - #38

Merged
REPPL merged 1 commit into
mainfrom
auto/iss-30-memory-ingest
Jul 12, 2026
Merged

fix: memory-ingest fetch/read boundary hardening (iss-30 subset)#38
REPPL merged 1 commit into
mainfrom
auto/iss-30-memory-ingest

Conversation

@REPPL

@REPPL REPPL commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Addresses the fetch/read-boundary subset of iss-30 (the memory-ingest input-boundary cluster). iss-30 stays open for its remaining instances — see below.

Fixes (internal/core/memory)

  • C12 — HTTP status. defaultFetch read the response body without checking the status, so a 404/500 error page was stored as source content. A non-2xx response is now an ingest error (logic extracted to a unit-tested readFetchedResponse).
  • P11 — SSRF. blockedFetchIP missed NAT64 (64:ff9b::/96) and 6to4 (2002::/16) IPv6 addresses embedding an IPv4 metadata/loopback/private destination; it now extracts and re-checks the embedded v4 (scoped to the well-known prefixes; both the DNS-resolution and dial-time guard paths hit it).
  • C13 — local size cap. materialFromLocal read a local file with no cap; it now rejects an over-cap file before reading it whole into RAM.
  • tilde. A ~user path was mangled into home+user; only ~ / ~/… expands now.

Tests (TDD, each fails on revert — verified)

Non-2xx status matrix (synthetic response), NAT64/6to4 SSRF cases added to the existing guard test, over-cap local file (asserts the size-cap message, not the downstream NUL check), and the tilde ~/ vs ~user behaviour. make preflight + record-lint green.

Reviewed

security-reviewer PASS (P11 closes the well-known transition vectors, verified by execution; C12/C13/tilde correct; no guard regressed). ruthless-reviewer FIX-FIRST — caught that the size test was a false pin (a sparse file trips the NUL check regardless); fixed to assert the cap message. Both NICE-TO-HAVEs applied.

iss-30 remaining (tracked, DECISIONS.md)

The larger "ingest test-suite" instances stay open: the --keep-original partial-failure reporting, CRLF parser-parity (parseFrontmatter vs splitFileFrontmatter), and broader URL-ingest/content-type/PDF path coverage.

Assisted-by: Claude:claude-opus-4-8

Addresses the fetch/read-boundary subset of iss-30 (parser-parity and
partial-failure-reporting instances remain a tracked follow-up; see DECISIONS.md):

- C12: defaultFetch read the response body without checking the HTTP status, so a
  404/500 error page was stored as source content. A non-2xx response is now an
  ingest error (logic extracted to readFetchedResponse and unit-tested).
- P11: blockedFetchIP missed NAT64 (64:ff9b::/96) and 6to4 (2002::/16) IPv6
  addresses embedding an IPv4 metadata/loopback/private destination. It now
  extracts and re-checks the embedded v4 (scoped to the well-known prefixes).
- C13: materialFromLocal read a local file with no size cap. It now rejects an
  over-cap file before reading it whole into RAM (test asserts the size-cap
  message so it fails on revert, not the downstream NUL check).
- tilde: a ~user path was mangled into home+"user"; only ~ or ~/ expands now.

Reviewed: security PASS, ruthless FIX-FIRST (a false-pin size test) fixed + doc
nit (embeddedIPv4 well-known-prefix scope) applied.

Assisted-by: Claude:claude-opus-4-8
@REPPL
REPPL merged commit 7d4972f into main Jul 12, 2026
12 checks passed
@REPPL
REPPL deleted the auto/iss-30-memory-ingest branch July 12, 2026 12:03
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.

1 participant