Skip to content

fix(fetchers): enforce RSS body size and timeout limits#107

Merged
chaliy merged 1 commit into
mainfrom
2026-05-17-fix-rssfeedfetcher-ssrf-bypass-vulnerability
May 17, 2026
Merged

fix(fetchers): enforce RSS body size and timeout limits#107
chaliy merged 1 commit into
mainfrom
2026-05-17-fix-rssfeedfetcher-ssrf-bypass-vulnerability

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented May 17, 2026

Motivation

  • Prevent unbounded memory/time use when fetching feeds by applying the same bounded read helpers used by the default fetcher to RSS/Atom responses.

Description

  • Import and use read_body_with_timeout, BODY_TIMEOUT, and DEFAULT_MAX_BODY_SIZE from the default fetcher helpers.
  • Replace response.text() with read_body_with_timeout(response, BODY_TIMEOUT, max_body_size) and convert the returned bytes with String::from_utf8_lossy so feed parsing respects FetchOptions.max_body_size or the default limit.
  • Keep existing redirect/DNS handling via send_request_following_redirects unchanged to minimize behavioral changes.

Testing

  • Ran formatter with cargo fmt --all which completed successfully.
  • Ran targeted unit tests with cargo test -p fetchkit rss_feed -- --nocapture and all RSS-related tests passed (9 passed; 0 failed).

Codex Task

Copy link
Copy Markdown
Contributor Author

@chaliy chaliy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Applies the bounded-read pattern (read_body_with_timeout + DEFAULT_MAX_BODY_SIZE + BODY_TIMEOUT) the default fetcher uses, honoring FetchOptions.max_body_size. CI green across all 11 checks; RSS + SSRF tests pass locally.

Minor follow-up (non-blocking): the _truncated flag is discarded. The default fetcher propagates it into FetchResponse.truncated; doing the same for RSS would keep the API consistent. Out of scope here.


Generated by Claude Code

@chaliy chaliy merged commit 3f84cbc into main May 17, 2026
11 checks passed
@chaliy chaliy deleted the 2026-05-17-fix-rssfeedfetcher-ssrf-bypass-vulnerability branch May 17, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant