Summary
A mass assignment flaw in Flowise's DocumentStore creation endpoint allows authenticated users to set sensitive fields, including the primary key (id) and internal state attributes, when creating DocumentStore objects.
Because the API effectively performs an implicit UPSERT with client-controlled identifiers, attackers can overwrite or take over existing DocumentStores, leading to broken object-level authorization and cross-workspace data compromise in multi-tenant deployments.
Affected context
This vulnerability occurs in Flowise deployments that expose the DocumentStore creation API to authenticated users and rely on a shared persistence layer (e.g., a database) across multiple workspaces or tenants.
The affected context involves:
- Backend logic that calls
repository.save()on user-supplied payloads - Client-controlled
idand state fields in the request body - Multi-workspace or multi-tenant setups where multiple users share the same DocumentStore table or collection
In such scenarios, the create endpoint behaves like an unguarded UPSERT operation, making it possible for one user to influence or overwrite objects associated with different workspaces.
Exploit preconditions
- Attack surface: HTTP API endpoint used to create DocumentStore entities.
- Required access: Authenticated application user with permission to create DocumentStores in at least one workspace.
- Trigger point: Sending a crafted POST request to the DocumentStore creation endpoint with:
- An
idfield matching an existing DocumentStore, and/or - Internal state or ownership fields set to attacker-controlled values.
- Why exploitation is possible:
- The server trusts client-supplied primary keys and internal fields.
repository.save()is used in a way that treats incoming data as a full entity, turning a create operation into an implicit UPSERT.- Object-level authorization checks are not tightly bound to the true ownership or workspace mapping of the object being persisted.
Why this happens
The core issue is a mass assignment pattern (CWE-915) combined with insecure direct object references (CWE-639).
Instead of whitelisting which fields a client may set, the backend directly maps the entire incoming JSON payload to the persistence model and calls repository.save().
When the persistence layer sees a client-supplied primary key, it may interpret the operation as an update of an existing record rather than creation of a new one.
Because ownership and workspace relationships are derived from fields that can be overwritten by the client, this breaks the authorization model and enables object takeover across workspaces.
At an abstract level, the bug is "trusting the client to define identity and state of server-side entities" without enforcing a strict separation between user-controlled fields and system-controlled fields.
Potential impact
- Attackers may overwrite existing DocumentStore objects by reusing known or guessed IDs.
- DocumentStores belonging to other users or workspaces could be reassigned or modified, leading to cross-workspace data exposure.
- Integrity of stored documents and configurations may be compromised through unauthorized edits or replacement.
- Application behavior relying on specific DocumentStore state can be manipulated, potentially affecting LLM flows and downstream processing.
- In multi-tenant environments, this may amount to a breach of tenant isolation and regulatory non-compliance.
General mitigation guidance
Effective mitigation focuses on separating client-controllable fields from system-managed identity and ownership attributes, and on enforcing object-level authorization:
- Use explicit DTOs or input models that expose only safe, non-sensitive fields to clients; never bind persistence entities directly to request bodies.
- Treat primary keys and ownership/workspace fields as server-controlled; generate IDs on the server and derive workspace/tenant assignments from the authenticated context, not from request payloads.
- Implement strict field-level whitelisting for mass assignment, ensuring internal state and relationship fields cannot be set or overridden by the client.
- Enforce object-level authorization on all write paths, validating that the current user is allowed to affect the specific object and workspace implied by the operation.
- Prefer separate, clearly distinguished endpoints for create vs. update to avoid accidental UPSERT semantics when using repository helpers.
How teams detect issues like this
Identifying this kind of vulnerability typically involves a combination of code analysis, testing, and policy enforcement:
- Static analysis and code review:
- Flag controllers or services that bind incoming JSON directly to persistence entities.
- Look for use of generic
save()/upsert()methods where theidfield is not sanitized or overwritten server-side. - Review any use of mass assignment utilities, ORM auto-mapping, or reflection-based field population for lack of whitelisting.
- Authorization reviews:
- Verify that object-level authorization is applied based on server-side knowledge of ownership and workspace membership, not on client-supplied identifiers.
- Check that multi-tenant boundaries are enforced at the query and update layers.
- Testing approaches:
- Add integration tests that attempt to create objects with existing IDs and confirm they cannot overwrite or take over other users' resources.
- Attempt to modify workspace or tenant identifiers via the API and verify the server ignores or rejects such changes.
- Automated code scanning tools can be configured with rules targeting mass assignment patterns and direct entity binding to help surface these issues early in development.

