mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-05-13 07:46:47 +00:00
🚦 feat: Make URL Auto-Submit Configurable (#12929)
`/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.
This commit is contained in:
parent
c7f38d9621
commit
37429e8a3e
2 changed files with 7 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue