[PR #22974] [CLOSED] fix(code-interpreter): inject Pyodide prompt into system message not user turn #26954

Closed
opened 2026-04-20 06:47:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: clawoss/fix/22965-pyodide-prompt-injection


📝 Commits (1)

  • ca19ae2 fix(code-interpreter): inject Pyodide prompt into system message not user turn

📊 Changes

1 file changed (+4 additions, -2 deletions)

View changed files

📝 backend/open_webui/utils/middleware.py (+4 -2)

📄 Description

The code interpreter prompt (Pyodide) was injected into the user turn via add_or_update_user_message, creating a prompt injection vulnerability where a user could override the code interpreter instructions.

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/22974 **Author:** [@BillionClaw](https://github.com/BillionClaw) **Created:** 3/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `clawoss/fix/22965-pyodide-prompt-injection` --- ### 📝 Commits (1) - [`ca19ae2`](https://github.com/open-webui/open-webui/commit/ca19ae272000fd28748d8273cfc94bf525f42891) fix(code-interpreter): inject Pyodide prompt into system message not user turn ### 📊 Changes **1 file changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+4 -2) </details> ### 📄 Description The code interpreter prompt (Pyodide) was injected into the user turn via add_or_update_user_message, creating a prompt injection vulnerability where a user could override the code interpreter instructions. 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-04-20 06:47:15 -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#26954