Advisory

GHSA-p4fx-23fq-jfg6

Details, part 3 of 3. The advisory

Details

The attacker never needs workspace.tools permission. The administrator's explicit decision to deny this user code execution capability is bypassed.

Remediation

Recommended Fix

Add the workspace.tools permission check to the update endpoint, matching the create endpoint's authorization gate:

File: backend/open_webui/routers/tools.py, after line 481 (after the existing access check)

# Add workspace.tools check for content changes (code execution)
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,
        )

This allows users with write grants to update tool metadata (name, description, valves) without workspace.tools, but requires the permission for content changes that trigger code execution.

Sources & licences