Summary
Langflow contained a broken access control issue in the _read_flow helper that failed to enforce ownership checks when retrieving flows by UUID.
Under normal authenticated operation, any logged-in user could read, modify, or delete flows belonging to other users, including accessing embedded plaintext API keys, by supplying their UUIDs.
Affected context
This vulnerability affects Langflow deployments that:
- Run with authentication enabled (
AUTO_LOGIN = False) - Use multi-user environments where flows are associated with specific users
- Allow users to reference flows by UUID (e.g., via API calls or UI actions)
In this context, the _read_flow helper did not constrain queries by the requesting user's identity, so any valid flow UUID could be used to operate on someone else's flow.
Exploit preconditions
- Attack surface: Application backend endpoints that read, update, or delete flows via UUID.
- Required access: Any authenticated user account on the Langflow instance (no special roles required).
- Trigger point: Supplying the UUID of a target flow to operations that invoke
_read_flow, such as viewing, editing, or deleting a flow. - Why exploitation is possible: The database query inside
_read_flowbranched on theAUTO_LOGINsetting but, when authentication was enabled, did not enforce auser_idownership check, causing the system to return or manipulate flows purely based on UUID.
Why this happens
The core issue is a broken access control pattern where authorization checks are incomplete and rely solely on an unscoped resource identifier.
Specifically, the _read_flow helper performed a database lookup by flow UUID and conditionally handled public/example flows when auto-login was enabled, but omitted a user_id filter on the authenticated path.
This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because a user-controlled UUID was sufficient to access another user's resource, and to CWE-862: Missing Authorization, since the code path lacked a definitive ownership or permission check.
The design assumed that possession of a valid UUID implied legitimacy, rather than validating that the requesting user was the owner of, or otherwise authorized for, the target flow.
Potential impact
- Unauthorized reading of other users' flows, including embedded plaintext API keys and other secrets.
- Modification of another user's AI agent logic and workflow definitions, potentially altering behavior or exfiltrating data.
- Deletion of flows belonging to other users, resulting in denial of service or data loss for affected accounts.
- Lateral access to external services or data sources configured in other users' flows via exposed credentials.
- Undermining of tenant isolation in shared or multi-team Langflow deployments.
General mitigation guidance
Effective mitigation focuses on enforcing consistent, explicit authorization at the resource access layer and avoiding reliance on opaque identifiers as proof of access.
Recommended defensive patterns include:
- Scoping all flow queries by the authenticated user's identity (e.g.,
WHERE id = :uuid AND user_id = :current_user_id) and only relaxing this for explicitly defined public resources with clear policy. - Centralizing authorization logic for resource access in a dedicated layer or service, rather than embedding conditional checks in helper functions.
- Implementing a clear model for public/example flows (e.g., a
visibilityfield) and deriving access decisions from that model instead of configuration flags likeAUTO_LOGIN. - Treating UUIDs and similar identifiers as untrusted, user-controlled input that always requires a permission check before returning or mutating data.
- Minimizing or encrypting sensitive secrets stored inside flows so that accidental exposure yields less impact, and segregating secret storage from general workflow metadata.
Designing the application so that the default path is scoped to the current user and all exceptions are narrowly defined reduces the risk of similar oversights.
How teams detect issues like this
Detection typically involves both code-level and runtime monitoring strategies:
- Static analysis and code review:
- Flag all resource lookups by UUID or primary key that do not also constrain by
user_id, tenant ID, or a similar ownership attribute. - Review helper functions and service methods that bypass centralized authorization middleware or contain configuration-based branching around access checks.
- Enforce secure coding guidelines stating that every data access path must have an explicit authorization decision.
- Automated policy enforcement:
- Use linters or SAST tools configured with custom rules to detect missing authorization checks around database queries for user-owned resources.
- Introduce architectural tests that verify all flow-related endpoints call a central authorization routine.
- Runtime and log-based detection:
- Log flow access events with requesting user ID and target flow ID, and analyze for patterns where many distinct owners' flows are accessed by a single account.
- Monitor for unusual deletion or modification activity across many users' flows from one source account.
Combining static enforcement with behavioral analytics improves the chance of spotting both existing issues and attempts to exploit them.

