Repository navigation
fix(ai-proxy): validate the Zendesk subdomain and refuse redirects on integration requests - #2039
Conversation
2 new issues
|
… integration requests The Zendesk subdomain must now be a single DNS label, and Zendesk and Snowflake integration requests fail with a 422 on any redirect. fixes PRD-1724 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3640dde to
08f5247
Compare
Tonours
left a comment
There was a problem hiding this comment.
Spec (PRD-1724): the ai-proxy fix matches the ticket, subdomain pattern and redirect: 'manual' included. The server-side scope is not covered.
Applies to: the PR description
Claude Opus 5.5 (claude-opus-5-5): Should fix: merging closes PRD-1724 while its server-side half is still open.
Code
PRD-1724 also asks to whitelist config keys per integration server-side, and fixes PRD-1724 closes it on merge.
A way out: link with Refs PRD-1724, or split the server work into its own ticket.
Reproduction
- Merge this PR.
- Open PRD-1724: it is Done while the server-side item has no change.
|
Claude Opus 5.5 (claude-opus-5-5): The PR description now links the ticket with WhyThe ticket also needs a change in another repository before it can close, so it stays open after this merge. |
|
Closed: the description now links How it was checkedThe predicate is a closing keyword for PRD-1724 in the pull request description. |
Tonours
left a comment
There was a problem hiding this comment.
Approved after /verify-fixes run 2039-20261024121938-Tonours-verify: 2 findings of 2039-20261023191852-Tonours closed or accepted, none reopened.
## @forestadmin/ai-proxy [1.15.1](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/ai-proxy@1.15.0...@forestadmin/ai-proxy@1.15.1) (2026-10-25) ### Bug Fixes * **ai-proxy:** validate the Zendesk subdomain and refuse redirects on integration requests ([#2039](#2039)) ([0f23cd0](0f23cd0))

Refs PRD-1724
What
getZendeskConfigrequires the subdomain to be a single DNS label (^[A-Za-z0-9-]{1,63}$), like Snowflake'sACCOUNT_IDENTIFIER_RE; anything else throwsAIBadRequestError(400) before a request is sent.integrations/fetch-without-redirect.ts: every Zendesk and Snowflake request (tools and config validation) goes through it. It sendsredirect: 'manual'and throwsAIToolUnprocessableError(422) on any 3xx. Neither API redirects, so no legitimate call is affected.Tests
test/integrations/fetch-without-redirect.test.tsruns real local servers (nofetchmock): 301/302/303/307/308 are refused and the redirect target receives nothing, including through a Zendesk tool and a Snowflake POST tool.zendesk/utils.test.ts: valid and invalid subdomains, and no request sent for an invalid one.fetchassertions now also expectredirect: 'manual'.Behavioral change
A connector saved with a subdomain that is not a single DNS label now fails when its tools load, as an invalid Snowflake account identifier already does.
Definition of Done
General
Security
🤖 Generated with Claude Code
Note
Refuse redirects on Zendesk and Snowflake integration requests and validate the Zendesk subdomain
fetchWithoutRedirectin fetch-without-redirect.ts. It forces manual redirect handling and raisesAIToolUnprocessableErrorfor any HTTP 300–399 response instead of following theLocationtargetfetchWithoutRedirect. Request URLs, headers, payloads, and response handling are unchangedassertValidSubdomainin utils.ts. It requires one DNS-label-like segment of 1–63 ASCII letters, digits, or hyphens.getZendeskConfignow calls it before building the base URL and throwsAIBadRequestErroron invalid valuesAIToolUnprocessableError; checkfetchWithoutRedirectand any integration not listed here that still uses direct fetchMacroscope summarized 08f5247.