Summary
Open WebUI exposes an API endpoint that allows any authenticated user to overwrite arbitrary knowledge base files by UUID without verifying ownership.
An attacker with read access to a shared knowledge base can escalate to write access, corrupt stored content, and control what the LLM returns to other users through RAG.
Affected context
This vulnerability affects Open WebUI deployments where:
- Multiple users share knowledge bases or have read access to common RAG content
- The
POST /api/v1/retrieval/process/files/batchendpoint is exposed to authenticated users - File references are based on UUIDs retrievable from
GET /api/v1/knowledge/{id}/files
In such environments, users who should only be able to read shared content can silently overwrite it, impacting all users relying on that knowledge base for LLM responses.
Exploit preconditions
- Attack surface: Open WebUI HTTP API (
/api/v1/retrieval/process/files/batch) - Required access: Any authenticated user account with at least read access to a knowledge base
- Information needed: UUIDs of target files, obtainable via
GET /api/v1/knowledge/{id}/filesor other listings - Trigger point: Submitting a crafted batch request that references the target file IDs with replacement content
- Why exploitation is possible: The file processing endpoint uses the file UUID as the sole authorization key and does not validate whether the caller owns or has write permission to the referenced files (CWE-639 – insufficient access control on direct object references).
Why this happens
The core issue is an authorization check that is missing at the object level on a write-capable endpoint.
The application trusts that possession of a file UUID implies permission to modify that file, but the UUIDs are discoverable by any user with read access to a shared knowledge base.
This design maps to CWE-639: Authorization Bypass Through User-Controlled Key, where an attacker can manipulate or reuse identifiers of internal objects (file IDs) to perform actions on resources they do not own because the server validates authentication but not per-object authorization.
Potential impact
- Unauthorized modification of knowledge base documents that other users rely on
- Integrity compromise of RAG responses, allowing the attacker to influence or fully control what the LLM tells other users
- Insertion of misleading, harmful, or malicious guidance into shared knowledge bases
- Undermining trust in AI outputs and internal documentation backed by the platform
- Potential indirect business impact if operational decisions are made based on corrupted LLM responses
General mitigation guidance
Effective mitigation focuses on enforcing strict, object-level authorization and reducing reliance on guessable or broadly exposed identifiers:
- Implement ownership and permission checks for every write or update operation on knowledge base files, ensuring the caller has explicit write access to each referenced file.
- Treat resource identifiers (such as file UUIDs) as opaque but not security-sensitive; do not rely on them alone for authorization.
- Centralize access control logic so that all file operations (read, write, delete) consistently enforce the same permission model.
- Prefer role- and permission-based access control where shared knowledge bases can be configured as read-only for most users, with separate roles for content maintainers.
- Log file changes and maintain version history to support rollback and auditing in case of unauthorized modifications.
How teams detect issues like this
Organizations can detect and monitor similar authorization weaknesses using:
- Static analysis and code review:
- Flag endpoints that perform create/update/delete actions on resources without explicit per-object permission checks.
- Look for patterns where only authentication is validated, but resource access is controlled solely by client-supplied IDs.
- Review controller and service layers for shared authorization utilities and verify they are applied to all modifying operations.
- API security testing:
- Use automated API scanners or fuzzers to attempt cross-user access to resources by reusing IDs obtained under a different account.
- Incorporate authorization tests into integration and regression test suites, including negative tests for write attempts from read-only users.
- Runtime monitoring and logging:
- Log file modification events with actor identity, source IP, and target resource IDs; alert on unusual patterns such as frequent edits by users who normally only read.
- Monitor for spikes in content changes in shared knowledge bases or anomalies in RAG responses that deviate from prior content.

