[PR #22967] [CLOSED] fix: move code interpreter prompt from user turn to system prompt #65806

Closed
opened 2026-05-06 11:47:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22967
Author: @BillionClaw
Created: 3/24/2026
Status: Closed

Base: mainHead: clawoss/fix/22965-code-interpreter-prompt-injection


📝 Commits (1)

  • 312626e fix: 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.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22967 **Author:** [@BillionClaw](https://github.com/BillionClaw) **Created:** 3/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `clawoss/fix/22965-code-interpreter-prompt-injection` --- ### 📝 Commits (1) - [`312626e`](https://github.com/open-webui/open-webui/commit/312626e19bdb54a982164948256e019922c15f36) fix: move code interpreter prompt from user turn to system prompt ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+2 -2) </details> ### 📄 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 11:47:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#65806