Summary
Dify up to version 1.14.1 contains an authorization bypass that lets any authenticated editor user configure and enable tracing for applications they do not own.
By abusing missing tenant ownership checks on trace configuration endpoints, an attacker can redirect messages and responses from victim applications to attacker-controlled LLM trace providers, exposing sensitive conversational data.
Affected context
This vulnerability manifests in multi-tenant Dify deployments where:
- Applications belong to distinct tenants or organizations.
- Trace configuration endpoints accept an application identifier and allow editor users to enable or modify tracing.
- The backend does not strictly verify that the requesting user belongs to the same tenant as the target application.
In such environments, any user with editor-level permissions, including those who self-register in open-signup cloud offerings, can potentially target applications owned by other tenants.
Exploit preconditions
- Attack surface: Dify HTTP API / web panel endpoints responsible for configuring LLM trace providers and enabling trace collection.
- Required access: An authenticated account with editor-level permissions in any tenant. In Dify Cloud, such accounts can be obtained via unauthenticated self-registration.
- Trigger point: The attacker sends requests to trace configuration endpoints referencing application IDs belonging to other tenants.
- Why exploitation is possible: The backend performs insufficient tenant ownership validation on the application identifier when creating or updating trace configurations, allowing cross-tenant access control bypass (CWE-639).
Why this happens
The underlying flaw is a broken authorization pattern where object access is granted based solely on user role (e.g., "editor") without validating that the user is associated with the tenant owning the target application.
This aligns with CWE-639: Authorization Bypass Through User-Controlled Key, where an attacker manipulates an identifier (such as an application ID) to act on resources outside their authorization scope.
In this case, trace configuration endpoints treat the supplied application identifier as trustworthy and fail to enforce strict tenant-level access control, enabling cross-tenant configuration changes and data redirection.
Potential impact
- Exposure of user prompts, responses, and other conversational data from victim applications to attacker-controlled tracing providers.
- Collection of sensitive information processed by LLM workflows, including potential secrets, PII, or business data.
- Insight into application behavior, prompt engineering strategies, and inference patterns that may aid further attacks.
- Undermining of tenant isolation guarantees in multi-tenant environments, eroding trust in hosted AI services.
General mitigation guidance
Effective mitigation focuses on enforcing strict, consistent tenant-aware authorization for all resource-modifying endpoints:
- Implement server-side checks that verify the requesting user's tenant membership and role against the tenant ownership of the target application before allowing trace configuration changes.
- Centralize authorization logic (e.g., via a dedicated access control layer or policy engine) instead of duplicating checks in individual handlers, reducing the chance of missing validations.
- Treat all client-supplied identifiers (application IDs, tenant IDs, project IDs) as untrusted and always resolve them through tenant-scoped queries bound to the authenticated principal.
- Apply least-privilege role design so that trace configuration or observability settings are limited to privileged roles when they affect data routing or cross-system exfiltration risk.
- Where possible, design trace provider integrations so that cross-tenant or externally controlled endpoints are opt-in and subject to additional review or approvals.
How teams detect issues like this
Detection generally involves a mix of code-centric and runtime analysis:
- Code review: Look for endpoints that accept application or tenant identifiers and modify configuration (e.g., tracing, logging, webhooks) while only checking role, not explicit tenant ownership.
- Static analysis: Configure rules to flag authorization checks that do not constrain resource queries by tenant or owner, or API handlers where IDs from the request are used directly in database queries.
- Access control testing: Incorporate multi-tenant penetration tests where a low-privileged user from Tenant A systematically attempts to act on resources of Tenant B by altering identifiers in requests.
- Runtime monitoring: Log and monitor trace configuration changes, including user identity, source tenant, and target application, and alert on suspicious cross-tenant patterns or unexpected trace destinations.

