From 37429e8a3ead68342cd71139be38b6923afd45f8 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sun, 3 May 2026 22:17:19 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A6=20feat:=20Make=20URL=20Auto-Submit?= =?UTF-8?q?=20Configurable=20(#12929)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `/c/new?prompt=…&submit=true` previously auto-submitted the prompt unconditionally. For deployments where users may receive crafted links from external sources, an authenticated victim's click can trigger an immediate, attacker-controlled prompt against a memory- or tool-enabled model — providing a 1-click vector for prompt-injection exfiltration via markdown image rendering. Add `interface.autoSubmitFromUrl` (default `true` to preserve current behavior). Operators handling sensitive memory/tool data can set it to `false` so URL-supplied prompts only pre-fill the composer; the user must press Send explicitly. --- client/src/hooks/Input/useQueryParams.ts | 7 +++++-- packages/data-provider/src/config.ts | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/hooks/Input/useQueryParams.ts b/client/src/hooks/Input/useQueryParams.ts index cea11dc351..48d3da90c8 100644 --- a/client/src/hooks/Input/useQueryParams.ts +++ b/client/src/hooks/Input/useQueryParams.ts @@ -266,7 +266,10 @@ export default function useQueryParams({ const { decodedPrompt, validSettings, shouldAutoSubmit } = processQueryParams(); const hasSettings = Object.keys(validSettings).length > 0; - if (!shouldAutoSubmit) { + const autoSubmitAllowed = startupConfig.interface?.autoSubmitFromUrl !== false; + const willAutoSubmit = shouldAutoSubmit && autoSubmitAllowed; + + if (!willAutoSubmit) { submissionHandledRef.current = true; } @@ -291,7 +294,7 @@ export default function useQueryParams({ } // Handle auto-submission - if (shouldAutoSubmit && decodedPrompt) { + if (willAutoSubmit && decodedPrompt) { if (hasSettings) { // Settings are changing, defer submission pendingSubmitRef.current = true; diff --git a/packages/data-provider/src/config.ts b/packages/data-provider/src/config.ts index d5165f5353..00d4f1a820 100644 --- a/packages/data-provider/src/config.ts +++ b/packages/data-provider/src/config.ts @@ -822,6 +822,7 @@ export const interfaceSchema = z .optional(), temporaryChat: z.boolean().optional(), temporaryChatRetention: z.number().min(1).max(8760).optional(), + autoSubmitFromUrl: z.boolean().optional(), runCode: z.boolean().optional(), webSearch: z.boolean().optional(), peoplePicker: z @@ -879,6 +880,7 @@ export const interfaceSchema = z public: false, }, temporaryChat: true, + autoSubmitFromUrl: true, runCode: true, webSearch: true, peoplePicker: {