Decidim vulnerable to possible CSRF attack at questionnaire templates preview
Description
Decidim is a participatory democracy framework. Starting in version 0.23.0 and prior to versions 0.27.5 and 0.28.0, the CSRF authenticity token check is disabled for the questionnaire templates preview. The issue does not imply a serious security thread as you need to have access also to the session cookie in order to see this resource. This URL does not allow modifying the resource but it may allow attackers to gain access to information which was not meant to be public. The issue is fixed in version 0.27.5 and 0.28.0. As a workaround, disable the templates functionality or remove all available templates.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
decidim-templatesRubyGems | >= 0.23.0, < 0.27.5 | 0.27.5 |
Affected products
1Patches
257a4b4677874Simplify the code related to questionnaire templates previews (#11743)
2 files changed · +4 −12
decidim-templates/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb+0 −2 modified@@ -8,8 +8,6 @@ module Admin class QuestionnaireTemplatesController < Decidim::Templates::Admin::ApplicationController include Decidim::TranslatableAttributes - skip_before_action :verify_authenticity_token, only: :preview - helper_method :template def index
decidim-templates/app/packs/src/decidim/templates/admin/choose_template.js+4 −10 modified@@ -13,16 +13,10 @@ $(() => { return; } const params = new URLSearchParams({ id: id }); - fetch(`${previewURL}?${params.toString()}`, { - method: "GET", - headers: { "Content-Type": "application/json" } - }).then((response) => response.text()).then((data) => { - const script = document.createElement("script"); - script.type = "text/javascript"; - script.innerHTML = data; - document.getElementsByTagName("head")[0].appendChild(script); - }).catch((error) => { - console.error(error); // eslint-disable-line no-console + Rails.ajax({ + url: `${previewURL}?${params.toString()}`, + type: "GET", + error: (data) => (console.error(data)) }); }
5542227be66eLoad script on autocomplete change
4 files changed · +25 −10
decidim-admin/app/assets/javascripts/decidim/admin/bundle.js+5 −5 modifieddecidim-admin/app/frontend/components/autocomplete.component.tsx+14 −4 modified@@ -118,18 +118,28 @@ export class Autocomplete extends React.Component<AutocompleteProps, Autocomplet this.setState({ selectedOption }); if (this.props.changeURL) { - -alert(`requesting get for changeURL ${this.props.changeURL}`) - axios.get(this.props.changeURL, { headers: { - Accept: "application/json" + Accept: "text/javascript" }, withCredentials: true, params: { id: selectedOption.value } }) + .then((response) => { + let script = document.createElement("script"); + script.type = "text/javascript"; + script.innerHTML = response.data; + document.getElementsByTagName("head")[0].appendChild(script); + }) + .catch((error: any) => { + if (axios.isCancel(error)) { + console.log("Request canceled", error.message); + } else { + console.log(error) + } + }); } }
decidim-templates/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb+2 −0 modified@@ -8,6 +8,8 @@ module Admin class QuestionnaireTemplatesController < Decidim::Templates::Admin::ApplicationController include Decidim::TranslatableAttributes + skip_before_action :verify_authenticity_token, only: :preview + helper_method :template def index
decidim-templates/app/views/decidim/templates/admin/questionnaire_templates/preview.js.erb+4 −1 modified@@ -1 +1,4 @@ -alert("preview!") \ No newline at end of file +/* eslint-disable no-var, prefer-template */ +(function () { + +}());
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
10- github.com/advisories/GHSA-f3qm-vfc3-jg6vghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-47635ghsaADVISORY
- github.com/decidim/decidim/blob/3187bdfd40ea1c57c2c12512b09a7fec0b2bed08/decidim-templates/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rbghsax_refsource_MISCWEB
- github.com/decidim/decidim/commit/5542227be66e3b6d7530f5b536069bce09376660ghsax_refsource_MISCWEB
- github.com/decidim/decidim/commit/57a4b467787448307b5d9b01ce6e2c8502e121acghsax_refsource_MISCWEB
- github.com/decidim/decidim/pull/11743ghsax_refsource_MISCWEB
- github.com/decidim/decidim/pull/6247ghsax_refsource_MISCWEB
- github.com/decidim/decidim/releases/tag/v0.27.5ghsax_refsource_MISCWEB
- github.com/decidim/decidim/releases/tag/v0.28.0ghsax_refsource_MISCWEB
- github.com/decidim/decidim/security/advisories/GHSA-f3qm-vfc3-jg6vghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.