Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
mdx 102 lines 3.8 KB
Raw
1 ---
2 title: "Proxy execute now enforces same-domain endpoints"
3 description: "The /api/v3/tools/execute/proxy endpoint rejects requests whose endpoint URL is on a different registrable domain than the connected account's base URL."
4 date: "2026-04-24"
5 ---
6
7 To prevent a connection's `Authorization` header from being forwarded to an unintended host, the proxy execute endpoint (`POST /api/v3/tools/execute/proxy`) now requires that the outbound `endpoint` URL share the same scheme and registrable domain (eTLD+1) as the connection's resolved `base_url`.
8
9 Cross-subdomain requests on the same registrable domain continue to work — for example, a Gmail connection with base `https://gmail.googleapis.com` can still call `https://www.googleapis.com/...`. Relative endpoints (`/users/me/messages`) are resolved against the connection's `base_url` as before and are unaffected.
10
11 <Callout type="warn">
12 **Breaking Change**
13
14 Existing proxy calls that pass an absolute `endpoint` URL whose registrable domain does not match the connection's `base_url` will now fail with `400 OriginMismatch` instead of being forwarded. Calls that omit both `connected_account_id` and `custom_connection_data` will fail with `400 MissingAuthContext` instead of being forwarded without auth.
15 </Callout>
16
17 ### Migration
18
19 If you currently pass an absolute URL that points at a different domain than your connection's `base_url`, switch to a relative endpoint (resolved against `base_url`) or an absolute URL under the same registrable domain.
20
21 **Before** — absolute URL on a different domain (will be rejected):
22
23 ```json
24 {
25 "endpoint": "https://api.someservice.com/v1/items",
26 "method": "GET",
27 "connected_account_id": "ca_..."
28 }
29 ```
30
31 **After** — relative endpoint (recommended):
32
33 ```json
34 {
35 "endpoint": "/v1/items",
36 "method": "GET",
37 "connected_account_id": "ca_..."
38 }
39 ```
40
41 **Or** — absolute URL on the same registrable domain as the connection's `base_url`:
42
43 ```json
44 {
45 "endpoint": "https://uploads.someservice.com/v1/items",
46 "method": "GET",
47 "connected_account_id": "ca_..."
48 }
49 ```
50
51 If your integration legitimately needs to call a different registrable domain for the same connection, reach out so we can add the additional host to the toolkit allowlist.
52
53 ### What changed
54
55 - Absolute `endpoint` URLs on a different registrable domain than the connection's `base_url` are rejected with HTTP `400 OriginMismatch`. The upstream request is never made.
56 - Proxy calls that provide neither `connected_account_id` nor `custom_connection_data` now return HTTP `400 MissingAuthContext` instead of being forwarded without auth.
57
58 ### Examples
59
60 Assume a connected account whose toolkit `base_url` is `https://api.linear.app`.
61
62 **Allowed — relative endpoint:**
63
64 ```bash
65 curl -X POST https://backend.composio.dev/api/v3/tools/execute/proxy \
66 -H 'x-api-key: <YOUR_API_KEY>' \
67 -H 'Content-Type: application/json' \
68 -d '{
69 "endpoint": "/graphql",
70 "method": "POST",
71 "connected_account_id": "ca_..."
72 }'
73 ```
74
75 **Allowed — same registrable domain (different subdomain):**
76
77 ```json
78 { "endpoint": "https://uploads.linear.app/...", "connected_account_id": "ca_..." }
79 ```
80
81 **Rejected — different registrable domain:**
82
83 ```json
84 { "endpoint": "https://attacker.example/leak", "connected_account_id": "ca_..." }
85 ```
86
87 Response:
88
89 ```json
90 {
91 "error": {
92 "code": "OriginMismatch",
93 "message": "Endpoint host does not match the connection's base_url host."
94 }
95 }
96 ```
97
98 ### What to do
99
100 - If you call proxy execute with absolute URLs, make sure the host matches (or is a subdomain of) the connection's `base_url`.
101 - Prefer relative endpoints (`/path`) — they are resolved against `base_url` and are not affected by this change.
102 - If your integration legitimately needs to span multiple registrable domains for the same connection, reach out to us so we can add the additional host to the toolkit allowlist.