mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #22967] [CLOSED] fix: move code interpreter prompt from user turn to system prompt #65806
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22967
Author: @BillionClaw
Created: 3/24/2026
Status: ❌ Closed
Base:
main← Head:clawoss/fix/22965-code-interpreter-prompt-injection📝 Commits (1)
312626efix: move code interpreter prompt from user turn to system prompt📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+2 -2)📄 Description
The code interpreter prompt (Pyodide) was being injected into the user turn via add_or_update_user_message, creating a prompt injection vulnerability — a user could override the instructions by modifying their message.
Changed add_or_update_user_message to add_or_update_system_message so the code interpreter prompt is injected as a system message where it cannot be tampered with by the user.
Fixes #22965
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.