fix: use hardened WebClientUtils builder in AI and Google Sheets plugins - #42177
Conversation
The Anthropic, OpenAI, and Google AI plugins, and the Google Sheets trigger path, built their outbound HTTP clients with raw WebClient.builder(), skipping the SSRF host filter that WebClientUtils.builder() wires in for every other outbound client. All request targets in these plugins are fixed provider endpoints, so this is consistency hardening rather than a fix for reachable behavior; it ensures a future configurable endpoint cannot ship without the filter. Each affected RequestUtils gains a regression test asserting that a request to a disallowed host is rejected by the filter. The tests were verified to fail against the previous builder wiring. Deliberately excluded: - RTSCallerCEImpl: its only target is the local RTS process, which the filter blocks by design (documented in the source). - appsmithAiPlugin: shares one client between external requests and, in some deployments, the local RTS process; filtering it requires a per-target client split and is out of scope here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThree AI plugin clients now use ChangesPlugin HTTP client security
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR hardens selected outbound clients with the existing host-filtered builder and adds targeted regression coverage without changing configured provider behavior. No actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the motivation, affected call sites, exclusions, impact, issue reference, and test results. It does not include the template's separate Testing and Communication sections or explicit validation checkbox selections, but the required information is mostly present.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
subrata71
left a comment
There was a problem hiding this comment.
LGTM. Are there any other plugins in the EE repo that might need similar adjustments?
|
EE-side sweep for the same pattern: one real site, fixed in the EE repo (see linked PR appsmithorg/appsmith-ee#9666) |
|
@wyatt What's remaining here? |
|
The EE side change was not approved yet. It was and now both are merged! |
Description
The Anthropic, OpenAI, and Google AI plugins, and the Google Sheets trigger path, built their outbound HTTP clients with raw
WebClient.builder(), skipping the SSRF host filter thatWebClientUtils.builder()wires in for every other outbound client (the Google Sheets execute path in the same file already used the hardened builder).All request targets in these plugins are fixed provider endpoints, so this is consistency hardening rather than a fix for reachable behavior: it ensures a future configurable endpoint (custom base URL, proxy, OpenAI-compatible gateway) cannot ship without the filter.
Each affected
RequestUtilsgains a regression test asserting that a request to a disallowed host is rejected by the filter withUnknownHostException: Host not allowed.. The tests were verified to fail against the previous builder wiring (the unfiltered client attempts a real connection instead).Call sites checked (all raw
WebClient.builder()usages in main code)Changed:
anthropicPluginRequestUtils.createWebClient()openAiPluginRequestUtils.createWebClient()googleAiPluginRequestUtils.createWebClient()googleSheetsPlugintriggerWithFlags()Deliberately excluded:
RTSCallerCEImpl— its only target is the local RTS process, which the filter blocks by design (documented in the source).appsmithAiPluginRequestUtils— shares one client between external requests and, in some deployments, the local RTS process; filtering it requires a per-target client split and is out of scope here.Impact on existing instances
APPSMITH_DISABLE_SSRF_FILTER=trueget the previous unfiltered behavior everywhere, including these clients.Linear: https://linear.app/appsmith/issue/APP-15866
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/33426610112
Commit: 57410c6
Cypress dashboard.
Tags:
@tag.AllSpec:
Mon, 31 Aug 2026 19:43:23 UTC
Summary by CodeRabbit
Security
Reliability
Tests