Advisory

PYSEC-2026-4230

Details, part 2 of 2. The advisory

Details

Expected output:

Direct /files/download as attacker -> 404
Project-scoped MCP resources/read -> cross-project-read-proof

Observed server logs during verification:

GET /api/v1/files/download/... 404 Not Found
POST /api/v1/mcp/project/<attacker-project-id>/streamable 200 OK
POST /api/v1/mcp/project/<attacker-project-id>/streamable 202 Accepted
POST /api/v1/mcp/project/<attacker-project-id>/streamable 200 OK

Impact
This is an authenticated IDOR / arbitrary file read issue in the MCP layer.

Any authenticated Langflow user who can access at least one project-scoped MCP endpoint can read files belonging to other users by supplying a victim file URI to resources/read.

Practical impact includes:

  • Cross-user disclosure of uploaded documents, CSV files, JSON files, prompts, and other flow-backed artifacts
  • Unauthorized access to sensitive business data stored in flow namespaces
  • Easier exploitation when global MCP helpers reveal other users' flow IDs and file names

Suggested Remediations

  1. Authorize resources/read against the authenticated context before calling storage. Resolve flow_id to a database object and require both: flow.user_id == current_user.id and, for project-scoped transports, flow.folder_id == current_project_id.
  1. Stop trusting arbitrary file-download URIs as resource identifiers. Instead, return opaque server-generated resource IDs from resources/list and resolve them server-side to an already authorized object.
  1. Scope global MCP enumeration helpers to the authenticated user. handle_list_resources() and handle_list_tools() should not query all flows when project_id=None; they should return only flows owned by the current user, or require elevated privileges for broader discovery.

Fix Status (Maintainer Triage Update — 2026-09-22)

This report is accurate. The vulnerable code path described above (missing
ownership check in handle_read_resource()) has since been fixed.

Corrected affected version range: >= 1.6.8, <= 1.9.0 (not <= 1.8.3 —
confirmed still vulnerable through v1.9.0; the fix landed with the v1.9.1
release, not later).

Fixed in: v1.9.1 (GitHub Release published 2026-04-24), via PR
#12818 — "fix(mcp): close path traversal + cross-user disclosure (PVR0754098)".

  • Backport commit on release-1.9.1: f0fd436fe9829192ee550e6cb46961a01dd37032
  • Corresponding commit on main: b8fe970493fd5fb2e1fc71dfccc79f90b76058fa

The fix:

  • handle_read_resource() now requires an authenticated user context and resolves the namespace segment of the URI to a Flow row scoped to Flow.user_id == current_user.id, additionally filtering on Flow.folder_id == project_id for project-scoped MCP servers (src/backend/base/langflow/api/v1/mcp_utils.py).
  • Rejects filenames containing .., /, or \ as defense-in-depth against path traversal, and applies the same containment check to the storage layer's get_file/get_file_stream/delete_file/get_file_size (local.py/s3.py, both in langflow and lfx).
  • handle_list_resources() / handle_list_tools() are now scoped to current_user.id on the global (non-project) MCP server, closing the cross-user enumeration this report also flagged.

Verified independently against langflow-ai/langflow @ 89444c3bb5
(release-1.11.0 branch, current as of 2026-09-22): the fix is present, and
the regression suite (src/backend/tests/unit/api/v1/test_mcp_utils.py,
21/21 passing) includes test_handle_read_resource_denies_other_users_flow,
which reproduces this report's exact cross-user scenario and asserts it now
raises ValueError("... access denied").

Sources & licences