[GH-ISSUE #2016] Custom tool webhooks lost legacy local URL and response-size guards #988

Closed
opened 2026-10-21 05:24:51 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2016

Originally assigned to: @Xelvanis on GitHub.

Problem

Legacy custom-tool webhook execution used the shared safe fetch path:

  • packages/server/src/services/tools/tool-executor.ts reads WEBHOOK_LOCAL_URLS_ENABLED through isWebhookLocalUrlsEnabled().
  • When that flag is not enabled, the request policy allows only https: and rejects local/private resolved addresses.
  • The legacy path also caps webhook responses with maxResponseBytes: 512 * 1024.

The refactor custom-tool executor is less bounded:

  • src-tauri/src/commands/storage/custom_tools.rs calls is_allowed_outbound_url(url, true), which accepts local http and https URLs unconditionally.
  • The success path reads response.text().await and returns the full text without the legacy success-body cap.

This is a webhook contract and hostability drift: static/webhook custom tools are supported in refactor, but the webhook path no longer preserves the legacy local-URL opt-in or response-size guard.

Expected behavior

Either restore the legacy safety policy for custom-tool webhooks or document the intentional refactor divergence and add equivalent bounds for hostable/native execution.

Acceptance criteria

  • Local/private webhook URLs are rejected unless the refactor has an explicit opt-in policy matching the intended runtime behavior.
  • Successful webhook response bodies have a bounded maximum size.
  • Error messages remain actionable for users configuring webhook tools.
  • Embedded Tauri and remote /api/invoke execution follow the same policy.
  • Focused proof covers a local URL should-not-match case and an oversized response case.

Context

Found during the Target 1 contracts-and-schemas batch-3 parityscan in #2011 while checking the positive static/webhook custom-tool contract. This is separate from the accepted script-tool divergence tracked in #1907.

Originally created by @Xelvanis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2016 Originally assigned to: @Xelvanis on GitHub. ## Problem Legacy custom-tool webhook execution used the shared safe fetch path: - `packages/server/src/services/tools/tool-executor.ts` reads `WEBHOOK_LOCAL_URLS_ENABLED` through `isWebhookLocalUrlsEnabled()`. - When that flag is not enabled, the request policy allows only `https:` and rejects local/private resolved addresses. - The legacy path also caps webhook responses with `maxResponseBytes: 512 * 1024`. The refactor custom-tool executor is less bounded: - `src-tauri/src/commands/storage/custom_tools.rs` calls `is_allowed_outbound_url(url, true)`, which accepts local `http` and `https` URLs unconditionally. - The success path reads `response.text().await` and returns the full text without the legacy success-body cap. This is a webhook contract and hostability drift: static/webhook custom tools are supported in refactor, but the webhook path no longer preserves the legacy local-URL opt-in or response-size guard. ## Expected behavior Either restore the legacy safety policy for custom-tool webhooks or document the intentional refactor divergence and add equivalent bounds for hostable/native execution. ## Acceptance criteria - Local/private webhook URLs are rejected unless the refactor has an explicit opt-in policy matching the intended runtime behavior. - Successful webhook response bodies have a bounded maximum size. - Error messages remain actionable for users configuring webhook tools. - Embedded Tauri and remote `/api/invoke` execution follow the same policy. - Focused proof covers a local URL should-not-match case and an oversized response case. ## Context Found during the Target 1 contracts-and-schemas batch-3 parityscan in #2011 while checking the positive static/webhook custom-tool contract. This is separate from the accepted script-tool divergence tracked in #1907.
bsakaguchi 2026-10-21 05:24:51 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#988
No description provided.