Summary
Decidim's comments API allows access to all commentable resources
Full technical description
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.
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.
The application does not perform an authorization check before performing a sensitive operation. Typical impact: unauthorized access to restricted functionality or data.
CVE-2026-40870 has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.31.1, 0.30.5); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Not available
Frequently Asked Questions
- What is CVE-2026-40870? CVE-2026-40870 is a high-severity missing authorization vulnerability in decidim-comments (rubygems), affecting versions > 0.31.0.rc1, < 0.31.1. It is fixed in 0.31.1, 0.30.5. The application does not perform an authorization check before performing a sensitive operation.
- How severe is CVE-2026-40870? CVE-2026-40870 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2026-40870?
decidim-comments(rubygems) (versions > 0.31.0.rc1, < 0.31.1)decidim-api(rubygems) (versions > 0.31.0.rc1, < 0.31.1)
- Is there a fix for CVE-2026-40870? Yes. CVE-2026-40870 is fixed in 0.31.1, 0.30.5. Upgrade to this version or later.
- Is CVE-2026-40870 exploitable, and should I be worried? Whether CVE-2026-40870 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-40870 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-40870?
- Upgrade
decidim-commentsto 0.31.1 or later - Upgrade
decidim-apito 0.31.1 or later - Upgrade
decidim-commentsto 0.30.5 or later - Upgrade
decidim-apito 0.30.5 or later
- Upgrade