Skip to content

GHSA-639h-86hw-qcjq CVE-2023-36465

Decidim has broken access control in templates

High RubyGems
Severity
7.1 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.67%
Chance of exploitation in the next 30 days. Higher than 52.17% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-284 Improper Access Control
CWE-732 Incorrect Permission Assignment for Critical Resource
Fix
Available
2 packages have a fixed version

Description

Impact

The templates module doesn't enforce the correct permissions, allowing any logged-in user to access to this functionality in the administration panel. An attacker could use this vulnerability to change, create or delete templates of surveys.

Affected versions

RubyGems

PackageVulnerableFixed in
decidim
>= 0.23.2, < 0.26.8
0.26.8
decidim
>= 0.27.0, < 0.27.4
0.27.4
decidim-templates
>= 0.23.2, < 0.26.8
0.26.8
decidim-templates
>= 0.27.0, < 0.27.4
0.27.4

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

decidim RubyGems → 0.26.8

bundler
bundle update decidim # Gemfile: gem "decidim", ">= 0.26.8"

decidim-templates RubyGems → 0.26.8

bundler
bundle update decidim-templates # Gemfile: gem "decidim-templates", ">= 0.26.8"

Severity breakdown

CVSS 3.1 7.1

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L

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

Weakness

CWE-284: Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.

How to prevent it
  • Architecture and Design, Operation: Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

CWE-732: Incorrect Permission Assignment for Critical Resource

The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.

How to prevent it
  • Implementation: When using a critical resource such as a configuration file, check to see if the resource has insecure permissions (such as being modifiable by any regular user) [REF-62], and generate an error or even exit the software if there is a possibility that the resource could have been modified by an unauthorized party.
  • Architecture and Design: Divide the software into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully defining distinct user groups, privileges, and/or roles. Map these against data, functionality, and the related resources. Then set the permissions accordingly. This will allow you to maintain more fine-grained control over your resources. [REF-207]
  • Architecture and Design, Operation: Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software. OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
  • Implementation, Installation: During program startup, explicitly set the default permissions or umask to the most restrictive setting possible. Also set the appropriate permissions during program installation. This will prevent you from inheriting insecure permissions from any user who installs or runs the program.
  • System Configuration: For all configuration files, executables, and libraries, make sure that they are only readable and writable by the software's administrator.
  • Documentation: Do not suggest insecure configuration changes in documentation, especially if those configurations can extend to resources and other programs that are outside the scope of the application.
  • Installation: Do not assume that a system administrator will manually change the configuration to the settings that are recommended in the software's manual.
  • Operation, System Configuration: Ensure that the software runs properly under the United States Government Configuration Baseline (USGCB) [REF-199] or an equivalent hardening configuration guide, which many organizations use to limit the attack surface and potential risk of deployed software.
  • Implementation, System Configuration, Operation: When storing data in the cloud (e.g., S3 buckets, Azure blobs, Google Cloud Storage, etc.), use the provider's controls to disable public access.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-r3v7-5x4c-c69q
Decidim: JWT-backed authentication can be replayed across organizations
High Also affects decidim
GHSA-3cx6-j9j4-54mp
Decidim's private data exports can lead to data leaks
Medium Also affects decidim
GHSA-cc4g-m3g7-xmw8
Decidim has a cross-site scripting vulnerability in the version control page
High Also affects decidim
GHSA-vvqw-fqwx-mqmm
Decidim::Admin vulnerable to cross-site scripting (XSS) in the admin panel with QuillJS WYSWYG editor
Medium Also affects decidim
GHSA-7cx8-44pc-xv3q
Decidim cross-site scripting (XSS) in the pagination
High Also affects decidim
GHSA-qcj6-vxwx-4rqv
Decidim vulnerable to data disclosure through the embed feature
Medium Also affects decidim
GHSA-9w99-78rj-hmxq
Cross-site scripting (XSS) in the dynamic file uploads
Medium Also affects decidim
GHSA-w3q8-m492-4pwp
Possibility to circumvent the invitation token expiry period
High Also affects decidim
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor