Skip to content

fix(loaders): SSRF-harden the #889 data loaders (integrates #1019) - #1031

Merged
AmitoVrito merged 7 commits into
mainfrom
security/loaders-ssrf-1019
Sep 9, 2026
Merged

AmitoVrito merged 7 commits into
mainfrom
security/loaders-ssrf-1019

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Integrates the #889 data-loader expansion (PR #1019, by @DhruvGarg111) with a security fix applied on top.

What

Review notes

Full adversarial review found the loaders otherwise solid: async offloading correct, Kafka is a real CI-wired testcontainer, pagination complete on every list endpoint, uv.lock consistent, no MagicMock. Box binary-file decoding deferred to #1030.

Closes #1019. Closes #1029.

Co-authored-by: Dhruv Garg [email protected]

DhruvGarg111 and others added 7 commits September 7, 2026 18:16
The new issue-889 loaders (graphql, figma, linear, monday, asana, clickup,
shopify, box, zoom) fetched developer-configured endpoints via a shared httpx
client created with follow_redirects=True and no SSRF validation — the exact
fail-open pattern hardened away in #1027 for agents/tools. A trusted-looking
endpoint could 302 to http://169.254.169.254/ (cloud metadata) or 127.0.0.1 and
the client would follow it silently.

http_client now yields a _GuardedHTTPClient wrapper that:
- disables auto-redirects (owned client uses follow_redirects=False) and follows
  redirects manually, re-validating every hop via assert_response_url_public;
- validates the initial URL on the library's own client. An injected client
  keeps its caller-owned request policy, but its redirect hops (server-supplied,
  attacker-influenced) are still validated.

Adds hermetic SSRF regression tests (IP literals, no network) covering private/
metadata/loopback/IPv6 endpoints, non-http schemes, redirect-to-private on an
injected client, allowed public redirects, and the redirect cap.

Co-authored-by: Dhruv Garg <[email protected]>
BoxLoader spread **file_data after setting source/row/file_id, so a Box file
whose own fields include "source", "row", or "file_id" would overwrite the
loader's provenance metadata. Spread the entry first, then set the reserved
keys.

Co-authored-by: Dhruv Garg <[email protected]>
@AmitoVrito
AmitoVrito merged commit 5d31e43 into main Sep 9, 2026
24 checks passed
@AmitoVrito
AmitoVrito deleted the security/loaders-ssrf-1019 branch September 9, 2026 16:26
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.

SSRF: #889 data loaders fetch endpoints without the shared URL guard

2 participants