CVE-2023-47635: Decidim templates Possible CSRF Attack At Questionnaire Vulnerability

MODERATE
Advisory Identifier: GHSA-f3qm-vfc3-jg6v
CVSS 4.5
CWE-918 CWE-352
Published
Advisory Summary

CVE-2023-47635 is a MODERATE (CVSS 4.5) possible csrf attack at questionnaire vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Decidim templates libraries in the RubyGems ecosystem. The issue involves possible csrf attack at questionnaire templates preview. Remediation is available by upgrading affected packages to version 0.27.5.

CVE-2023-47635 at a Glance

CVE Identifier CVE-2023-47635
GHSA Identifier GHSA-f3qm-vfc3-jg6v
Severity MODERATE
CVSS v3.1 Base Score 4.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Decidim templates
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 4.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2023-47635

To remediate this vulnerability, upgrade all affected Decidim templates dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

decidim-templates fixed: 0.27.5
Upgrade decidim-templates to 0.27.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for decidim-templates

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-47635, inspect your project dependencies for Decidim templates:

inspect dependencies for decidim-templates

Analyze the terminal output to locate any version of Decidim templates in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.27.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Decidim templates, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The CSRF authenticity token check is currently disabled for the questionnaire templates preview as per: https://github.com/decidim/decidim/blob/3187bdfd40ea1c57c2c12512b09a7fec0b2bed08/decidim-templates/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb#L11 This was introduced by this commit in the PR that introduced this feature (#6247): https://github.com/decidim/decidim/pull/6247/commits/5542227be66e3b6d7530f5b536069bce09376660 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. ### Patches #11743 ### Workarounds Disable the templates functionality or remove all available templates. ### References #11743

CVE-2023-47635 Affected Decidim templates Versions

1 component(s)
Fixed Versions:
0.27.5
Product / Package Ecosystem Affected Versions Fixed Version
decidim-templates
RubyGems
≥ 0.23.0
< 0.27.5
0.27.5

References

Frequently Asked Questions

What is CVE-2023-47635?
CVE-2023-47635 is a security vulnerability in Decidim templates involving Possible CSRF attack at questionnaire templates preview under CWE-918: Server-Side Request Forgery (SSRF).
Which Decidim templates versions are affected?
Affected versions include releases prior to 0.27.5 across affected packages: decidim-templates.
What version fixes CVE-2023-47635?
Upgrading to 0.27.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is decidim-templates affected?
Yes, decidim-templates is affected in releases prior to 0.27.5. Upgrade your dependency to 0.27.5 or later.
What is the CVSS score of CVE-2023-47635?
CVE-2023-47635 has a CVSS v3.1 base score of 4.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2023-47635?
CVE-2023-47635 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check RubyGems dependencies for CVE-2023-47635?
Run the dependency tree command: 'inspect dependencies for decidim-templates'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f3qm-vfc3-jg6v",
  "modified" : "2024-02-20T22:34:19Z",
  "published" : "2024-02-20T18:03:12Z",
  "aliases" : [ "CVE-2023-47635" ],
  "summary" : "Possible CSRF attack at questionnaire templates preview",
  "details" : "### Impact\nThe CSRF authenticity token check is currently disabled for the questionnaire templates preview as per:\nhttps://github.com/decidim/decidim/blob/3187bdfd40ea1c57c2c12512b09a7fec0b2bed08/decidim-templates/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb#L11\n\nThis was introduced by this commit in the PR that introduced this feature (#6247):\nhttps://github.com/decidim/decidim/pull/6247/commits/5542227be66e3b6d7530f5b536069bce09376660\n\nThe 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.\n\n### Patches\n#11743\n\n### Workarounds\nDisable the templates functionality or remove all available templates.\n\n### References\n#11743",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "decidim-templates"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.23.0"
      }, {
        "fixed" : "0.27.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/security/advisories/GHSA-f3qm-vfc3-jg6v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-47635"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/pull/11743"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/pull/6247"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/commit/5542227be66e3b6d7530f5b536069bce09376660"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/commit/57a4b467787448307b5d9b01ce6e2c8502e121ac"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/decidim/decidim"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/blob/3187bdfd40ea1c57c2c12512b09a7fec0b2bed08/decidim-templates/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb#L11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/releases/tag/v0.27.5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/releases/tag/v0.28.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352", "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-20T18:03:12Z",
    "nvd_published_at" : "2024-02-20T18:15:50Z"
  }
}