Skip to content

Decidim's comments API allows access to all commentable resources

High severity GitHub Reviewed Published Apr 13, 2026 in decidim/decidim • Updated Apr 15, 2026

Package

bundler decidim-api (RubyGems)

Affected versions

> 0.31.0.rc1, < 0.31.1
>= 0.0.1, < 0.30.5

Patched versions

0.31.1
0.30.5
bundler decidim-comments (RubyGems)
> 0.31.0.rc1, < 0.31.1
>= 0.0.1, < 0.30.5
0.31.1
0.30.5

Description

Impact

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.

Patches

Not available

Workarounds

To mitigate the issue, you can 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 with the following code (needs to run during application initialization):

# Within your application
# config/initializers/limit_api_access.rb

module LimitApiAccess
  extend ActiveSupport::Concern

  included do
    prepend_before_action do |controller|
      unless controller.send(:user_signed_in?)
        render plain: I18n.t("actions.login_before_access", scope: "decidim.core"), status: :unauthorized
      end
    end
  end
end

Rails.application.config.to_prepare do
  Decidim::Api::ApplicationController.include(LimitApiAccess)
end

Please note that this would only disable public access to the API and all authenticated users would be still able to exploit the vulnerability. This may be sufficient for some installations, but not for all.

Another workaround is to limit the availability of the /api endpoint to only trusted ranges of IPs that need to access the API. The following Nginx configuration would help limiting the API access to only specific IPs:

location /api {
  allow 192.168.1.100;
  allow 192.168.1.101;
  deny all;
}

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.

If you 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.

References

@andreslucena andreslucena published to decidim/decidim Apr 13, 2026
Published to the GitHub Advisory Database Apr 14, 2026
Reviewed Apr 14, 2026
Last updated Apr 15, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

EPSS score

Weaknesses

Missing Authorization

The product does not perform an authorization check when an actor attempts to access a resource or perform an action. Learn more on MITRE.

CVE ID

CVE-2026-40870

GHSA ID

GHSA-ghmh-q25g-gxxx

Source code

Credits

Loading Checking history
Improvements are not currently accepted on this advisory because it uses an unsupported versioning operator. Read more and discuss here.