Summary
Decidim's root-level commentable field in the public API exposes all commentable resources without performing authorization checks.
When the /api endpoint is left publicly accessible (the default), an attacker can query and enumerate commentable content, including material from private or restricted participation spaces, leading to unintended data exposure.
Affected context
This vulnerability appears in Decidim deployments that:
- Expose the
/apiendpoint over the network (especially with default, public access), and - Rely on Decidim to enforce access controls around commentable resources, such as private participation spaces or restricted processes.
The issue specifically affects API calls that use the root-level commentable field, which aggregates all commentable resources without applying the permission checks that would normally gate access in other parts of the application.
Exploit preconditions
- Attack surface: HTTP(S) access to the Decidim
/apiendpoint. - Required access:
- In the default configuration: no authentication is required; any internet or network user can reach the endpoint.
- With "Force users to authenticate before access organization" enabled and applied to the API: attacker must hold a valid user account.
- Trigger point: Requests that use the root-level
commentablefield in the API schema to list or access commentable resources. - Why exploitation is possible: The API code path that resolves the
commentablefield does not enforce authorization checks, allowing retrieval of resources regardless of the caller's permissions or the resource's intended visibility.
Why this happens
The underlying bug class is missing authorization logic on a sensitive API field that aggregates commentable resources.
While other areas of the application rely on role- and context-aware permission checks, the root commentable field bypasses or omits these checks when resolving data, effectively treating all commentable resources as publicly readable.
This aligns with CWE-862: Missing Authorization, where a function or endpoint that should require access control is callable without verifying the caller's privileges.
Potential impact
- Unauthorized reading of comments and related metadata from private or restricted participation spaces.
- Exposure of discussion threads that were intended only for authenticated or role-limited users.
- Inference of sensitive organizational activity (e.g., which topics are under private discussion, participation patterns).
- Privacy impact for users whose contributions or identities are expected to remain within closed processes.
- Increased reconnaissance capability for attackers preparing targeted social engineering or influence operations.
General mitigation guidance
Effective mitigation typically focuses on restoring strong, centralized authorization on API access and data resolution:
- Ensure that all API fields which expose domain objects (like
commentable) consistently enforce the same permission checks as the main application, ideally via a shared authorization layer. - Restrict unauthenticated access to the
/apiendpoint; treat it as a privileged interface rather than an inherently public one. - Align API schema design with your access-control model, avoiding root-level aggregators that bypass context (e.g., participation space, process, or group) when resolving resources.
- Apply least-privilege principles to API consumers, granting only the minimal scopes or roles needed for their use cases.
- Use configuration or middleware that requires authentication and, where appropriate, additional authorization checks before returning any non-public resources.
How teams detect issues like this
To detect this type of issue and similar authorization gaps:
- Perform authorization-focused code reviews for API resolvers, controllers, or GraphQL fields that aggregate or list resources, checking that each path calls a central permission-checking mechanism.
- Apply static analysis or custom linting rules looking for data access functions that are callable without accompanying authorization predicates or policy checks.
- Implement security tests that exercise API endpoints using both authenticated and unauthenticated clients, verifying that private or restricted resources are not returned.
- Monitor access logs for unusual enumeration patterns against the
/apiendpoint, such as large-scale listing of commentable resources or repeated probing of participation spaces. - Integrate automated API security testing (DAST/API scanners) in CI/CD to flag endpoints that return sensitive content without authentication.

