fix(fetchers): harden arxiv fetcher input and body limits#116
Merged
chaliy merged 2 commits intoMay 17, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
/abs/...or/pdf/...path segments were interpolated into the arXiv API query and the full API response was read without size limits.Description
is_valid_paper_id) inArXivFetcher::parse_urlto reject IDs containing unsafe characters such as&and other non-arXiv-safe characters, preventing query-string injection.https://export.arxiv.orginstead ofhttp://export.arxiv.orgto protect against response tampering.max_body_sizeand timeouts by reusing the sharedread_body_with_timeouthelper andDEFAULT_MAX_BODY_SIZE/BODY_TIMEOUTfrom the default fetcher instead of callingresponse.text()unbounded.test_rejects_injected_paper_id) to assert that injected IDs are rejected; the change is contained tocrates/fetchkit/src/fetchers/arxiv.rs.Testing
cargo fmt --alland formatting completed successfully.cargo test -p fetchkit arxivand the arXiv test suite passed: 14 tests ran and all passed.Codex Task