Repository navigation
Validate /asyncquery callbacks and bound query request bodies - #195
Merged
Merged
Conversation
Fixes #180 (callback SSRF): a callback must be http/https and resolve only to public addresses unless the host/network is in CALLBACK_ALLOWED_HOSTS; cloud metadata addresses are refused even when allowlisted. Checked at intake (422, nothing stored) and again in finish_query before delivery. compose.yml allowlists host.docker.internal and the docker bridge range so the local run_query.py --async flow keeps working. Fixes #183 (unbounded query bodies): /query and /asyncquery read the body through _read_body_within_limit against QUERY_MAX_REQUEST_SIZE (default 100MB, 413 when over). A new REQUEST_BODY_IDLE_TIMEOUT_SEC (default 30s) drops a body that stops arriving with 408 on the query and callback paths, closing the lying-Content-Length slowloris a size cap can't catch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2yuRDzpv1Yxh7x7StsDVK
Codecov Report❌ Patch coverage is
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
maximusunc
pushed a commit
that referenced
this pull request
Oct 29, 2026
…aps) Callback URL validation (intake and again in finish_query) and the query body size cap / idle timeout (413 / 408) come in as they are. Left out: devel's TRAPI 2.0 query validation at intake (TRAPIRequestError -> 400, and the ARAX route's validate_arax_query / parse_arax_query_body); finish_query keeps 1.6's send_callback (no has_logs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TtsBikU9y9AFQ5uu9tcioz
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.
Fixes #180 (callback SSRF): a callback must be http/https and resolve only to public addresses unless the host/network is in CALLBACK_ALLOWED_HOSTS; cloud metadata addresses are refused even when allowlisted. Checked at intake (422, nothing stored) and again in finish_query before delivery. compose.yml allowlists host.docker.internal and the docker bridge range so the local run_query.py --async flow keeps working.
Fixes #183 (unbounded query bodies): /query and /asyncquery read the body through _read_body_within_limit against QUERY_MAX_REQUEST_SIZE (default 100MB, 413 when over). A new REQUEST_BODY_IDLE_TIMEOUT_SEC (default 30s) drops a body that stops arriving with 408 on the query and callback paths, closing the lying-Content-Length slowloris a size cap can't catch.
Claude-Session: https://claude.ai/code/session_01S2yuRDzpv1Yxh7x7StsDVK