Summary
Decidim's JWT-backed API authentication may accept a token issued for one organization when requests are made against another organization selected by the current host. An attacker who possesses a valid JWT from one tenant could use it to access participant details and potentially reach proposal answer operations in a different tenant.
Affected context
The issue occurs in Decidim deployments using JWT-backed API authentication with multiple organizations or tenants. It becomes risky when the organization identified by the current host is not cryptographically or authoritatively bound to the tenant context represented by the JWT, allowing authentication to succeed without sufficient tenant-level authorization.
Exploit preconditions
- Attack surface: Decidim API endpoints using JWT-backed authentication
- Required access: A valid JWT issued for an organization, plus the ability to send authenticated requests to another tenant's host or API context
- Trigger point: API requests that access
participantDetailsdata or reach theproposal.answermutation path - Why exploitation is possible: The application authenticates the token but does not adequately verify that its tenant identity matches the organization selected from the current host
Why this happens
The underlying bug is a failure to bind authentication context to the tenant or organization selected for the request. A JWT can be valid in isolation while still being unauthorized for the organization serving the request, creating an authorization decision based on incomplete tenant context.
This maps primarily to CWE-639: Authorization Bypass Through User-Controlled Key because a request-controlled organizational context can influence access decisions without a sufficient relationship check. It is also associated with CWE-863: Incorrect Authorization, since authenticated users may be permitted to access data or operations outside their authorized tenant.
Potential impact
- An attacker may read participant details belonging to another organization.
- An attacker could reach proposal answer functionality outside the JWT's issuing tenant.
- Cross-tenant data confidentiality could be reduced.
- Unauthorized mutations may alter participatory or proposal-related records.
- Tenant isolation controls could be weakened across a shared Decidim deployment.
General mitigation guidance
Mitigation typically focuses on making tenant identity an explicit part of every authorization decision rather than relying on token validity alone.
Common defensive patterns include:
- Binding JWT claims, trusted host configuration, and resolved organization identifiers through a consistent server-side authorization check.
- Rejecting requests when the token tenant and host-selected tenant do not match.
- Applying tenant-scoped authorization to both queries and mutations, including participant data and proposal operations.
- Avoiding user-controlled tenant identifiers as the sole basis for selecting authorization context.
- Using least-privilege service and user permissions within each organization.
- Logging and monitoring cross-tenant token, host, and resource mismatches.
How teams detect issues like this
Organizations commonly detect this class of issue through:
- Static and architectural reviews of JWT validation and tenant-resolution code.
- Code review checks verifying that every tenant-scoped query and mutation performs an organization authorization test.
- Integration tests that replay a token from one tenant against another tenant's host and confirm denial.
- API policy tests covering both read operations and state-changing mutations.
- Monitoring for authenticated requests where JWT tenant claims differ from the resolved organization.
Automated application security testing and policy-aware API review tools can help identify missing tenant-boundary checks.

