Fix stale version stamp, ingest SSRF, non-atomic artifact write #1

Merged
flan merged 1 commits from fix/repo-review-2026-07-19 into main 2026-07-19 16:53:58 -04:00
Owner

Closes 3 repo-review findings:

  • 186900c8ca13 (bug) __version__ bumped to 0.8.3 to match pyproject; added a pin test.
  • cea937927c4f (smell) fetch_article_text rejects private/loopback/link-local/reserved hosts and re-validates each redirect hop (manual, capped) — blocks SSRF incl. cloud metadata.
  • ce3074af0826 (smell) write_json uses temp file + os.replace() for atomic visibility.

73 tests pass (67+6), ruff clean.

Closes 3 repo-review findings: - `186900c8ca13` (bug) `__version__` bumped to 0.8.3 to match pyproject; added a pin test. - `cea937927c4f` (smell) fetch_article_text rejects private/loopback/link-local/reserved hosts and re-validates each redirect hop (manual, capped) — blocks SSRF incl. cloud metadata. - `ce3074af0826` (smell) write_json uses temp file + `os.replace()` for atomic visibility. 73 tests pass (67+6), ruff clean.
flan added 1 commit 2026-07-19 16:50:58 -04:00
- __version__ was stuck at 0.8.2 after the 0.8.3 release, so every ratings
  and manifest artifact carried the wrong pipeline_version; bumped to match
  pyproject.toml and added a regression test pinning the two together.
- fetch_article_text followed an RSS entry's <link> wherever it pointed,
  including through redirects, with no check on the resolved address. A
  compromised or malicious feed could aim it at an internal address (cloud
  metadata, LAN service). The host and every redirect hop are now resolved
  and rejected if they land on a private, loopback, link-local, or otherwise
  non-public range.
- artifacts.write_json wrote the target path in place, so serve.py (a
  separate process reading the same releases volume) could read a partially
  written or truncated artifact. It now writes to a temp file in the same
  directory and swaps it into place with os.replace.
flan merged commit 3b9a4c4ae9 into main 2026-07-19 16:53:58 -04:00
flan deleted branch fix/repo-review-2026-07-19 2026-07-19 16:53:58 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: flan/tiltmeter#1