/

CVE-2026-40870

Severity:

HIGH RISK

(7.5)

Missing Authorization in Decidim /api Endpoint

CVE-2026-40870

Deferred

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Unauthorized Data Access / Information Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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 /api endpoint 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 /api endpoint.
  • 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 commentable field in the API schema to list or access commentable resources.
  • Why exploitation is possible: The API code path that resolves the commentable field 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 /api endpoint; 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 /api endpoint, 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.

Sources

SourceLink
github.comgithub.com/decidim/decidim/security/advisories/GHSA-ghmh-q25g-gxxx

Frequently asked

questions

Yes. If the /api endpoint is reachable from the internet and left in its default, publicly accessible state, any remote user can query the commentable field to access resources without authorization checks.

Not in the default configuration: no login is needed if /api is public. If the instance enables the setting to force authentication before accessing the organization and this policy is applied to the API, an attacker must at least have a valid user account, but does not need elevated roles.

Introduce mandatory, centralized authorization checks on all data-resolving logic behind the commentable field and similar API fields, ensuring that every returned resource is filtered according to the caller's permissions and the resource's visibility rules. In parallel, restrict access to the /api endpoint to authenticated and properly authorized clients.

Adopt an "authorize-by-default" API design: route all data access through a common policy engine or authorization layer, avoid special-case shortcuts for aggregating fields, require authentication for non-trivial API endpoints, and include access-control tests and code-review checklists that explicitly verify that each endpoint enforces the correct permissions.

Find out what's already
exploitable in your codebase.