Missing AuthorizationWeakness · CWE-862

CVE-2026-40870

HIGH · 7.5 CVSS v3.1 Published 2026-04-21
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
84/100
Remediation priority · High
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Decidim is a participatory democracy framework. Starting in version 0.0.1 and prior to versions 0.30.5 and 0.31.1, the root level `commentable` field in the API allows access to all commentable resources within the platform, without any permission checks. All Decidim instances are impacted that have not secured the `/api` endpoint. The `/api` endpoint is publicly available with the default configuration. Versions 0.30.5 and 0.31.1 fix the issue. As a workaround, limit the scope to only authenticated users by limiting access to the `/api` endpoint. This would require custom code or installing the 3rd party module `Decidim::Apiauth`. With custom code, the `/api` endpoint can be limited to only authenticated users. The same configuration can be also used without the `allow` statements to disable all traffic to the the `/api` endpoint. When considering a workaround and the seriousness of the vulnerability, please consider the nature of the platform. If the platform is primarily serving public data, this vulnerability is not serious by its nature. If the platform is protecting some resources, e.g. inside private participation spaces, the vulnerability may expose some data to the attacker that is not meant public. For those who have enabled the organization setting "Force users to authenticate before access organization", the scope of this vulnerability is limited to the users who are allowed to log in to the Decidim platform. This setting was introduced in version 0.19.0 and it was applied to the `/api` endpoint in version 0.22.0.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

This is an IDOR/authorization bypass vulnerability in Decidim's REST API where the root-level `commentable` field exposes all commentable resources without any permission checks. The `/api` endpoint is publicly accessible by default, allowing unauthenticated attackers to access potentially sensitive data within private participation spaces.

MitigationRestrict access to the `/api` endpoint to authenticated users only by installing the Decidim::Apiauth module, applying custom authorization code, or enabling the organization setting 'Force users to authenticate before access organization' (available since v0.22.0).

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Confirm REST API is enabled
    Inspect the Decidim initialization configuration (config/initializers/decidim.rb) or environment variables for the REST API feature flag
    Affected if The REST API is enabled and the /api endpoint is routing requests
  2. Test /api endpoint unauthenticated access
    Send an HTTP GET request to /api (or /api/v1) without any authentication headers and observe whether the endpoint returns a successful response
    Affected if The endpoint responds with 200 OK or exposes data without requiring authentication
  3. Verify organization authentication setting
    Query the organizations database table or inspect the Decidim admin panel for the 'force_users_to_authenticate_before_access_organization' setting
    Affected if This setting is disabled or absent, allowing anonymous access to the API
  4. Check if Apiauth module is installed
    Inspect the Gemfile for the decidim-apiauth gem or check config/routes.rb for the Decidim::Apiauth module inclusion
    Affected if The Apiauth module is not present in the application
  5. Review API endpoint permissions on commentable resources
    Make a request to the /api endpoint and examine the response for the root-level 'commentable' field, noting whether it exposes resources from private participation spaces
    Affected if The response contains a 'commentable' field exposing resources without permission checks

The environment is affected if the /api endpoint is publicly accessible without authentication and returns data through the unprotected commentable field.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Restrict access to the `/api` endpoint to authenticated users only by installing the Decidim::Apiauth module, applying custom authorization code, or enabling the organization setting 'Force users to authenticate before access organization' (available since v0.22.0).

Recommended fix High confidence

Decidim version 0.31.1 (latest fixed release)

  1. Upgrade Decidim to version 0.30.5 or 0.31.1 to resolve the missing authorization vulnerability in the `/api` endpoint
  2. After upgrading, verify that the commentable resources now properly enforce permission checks
  3. If immediate upgrade is not possible, implement a workaround by restricting `/api` endpoint access to authenticated users only using custom code or by installing the Decidim::Apiauth module
  4. If the platform only serves public data, consider whether the default public access is acceptable based on your organization's security requirements
Caveat Review Decidim release notes for 0.30.5 and 0.31.1 to check for any breaking changes between your current version and the fixed release, particularly regarding API behavior and authorization changes

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation3.0 h
  • Testing2.0 h
  • Review / QA1.0 h
8.0 hours of engineering $1,420
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,272.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-40870 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-40870 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data