From ea78ef5d16703d2755234adb9f3d7641039db551 Mon Sep 17 00:00:00 2001 From: Al Snow Date: Wed, 21 Feb 2024 16:06:26 -0500 Subject: [PATCH 1/2] GHSA SYNC: 8 brand new/as-is advisories --- gems/decidim-admin/CVE-2023-48220.yml | 96 +++++++++++++++++++++++ gems/decidim-core/CVE-2023-51447.yml | 48 ++++++++++++ gems/decidim-system/CVE-2023-48220.yml | 73 +++++++++++++++++ gems/decidim-templates/CVE-2023-47635.yml | 42 ++++++++++ gems/decidim/CVE-2023-47634.yml | 24 ++++++ gems/decidim/CVE-2023-48220.yml | 73 +++++++++++++++++ gems/decidim/CVE-2023-51447.yml | 48 ++++++++++++ gems/devise_invitable/CVE-2023-48220.yml | 72 +++++++++++++++++ 8 files changed, 476 insertions(+) create mode 100644 gems/decidim-admin/CVE-2023-48220.yml create mode 100644 gems/decidim-core/CVE-2023-51447.yml create mode 100644 gems/decidim-system/CVE-2023-48220.yml create mode 100644 gems/decidim-templates/CVE-2023-47635.yml create mode 100644 gems/decidim/CVE-2023-47634.yml create mode 100644 gems/decidim/CVE-2023-48220.yml create mode 100644 gems/decidim/CVE-2023-51447.yml create mode 100644 gems/devise_invitable/CVE-2023-48220.yml diff --git a/gems/decidim-admin/CVE-2023-48220.yml b/gems/decidim-admin/CVE-2023-48220.yml new file mode 100644 index 0000000000..06d3d77391 --- /dev/null +++ b/gems/decidim-admin/CVE-2023-48220.yml @@ -0,0 +1,96 @@ +--- +gem: decidim-admin +cve: 2023-48220 +ghsa: w3q8-m492-4pwp +url: https://github.com/decidim/decidim/security/advisories/GHSA-w3q8-m492-4pwp +title: Possibility to circumvent the invitation token expiry period +date: 2024-02-20 +description: | + + ### Impact + + The invites feature allows users to accept the invitation for an + unlimited amount of time through the password reset functionality. + + When using the password reset functionality, the `devise_invitable` + gem always accepts the pending invitation if the user has been + invited as shown in this piece of code within the `devise_invitable` gem: + https://github.com/scambra/devise_invitable/blob/41f58970ff76fb64382a9b9ea1bd530f7c3adab2/lib/devise_invitable/models.rb#L198 + + The only check done here is if the user has been invited but the code + does not ensure that the pending invitation is still valid as defined + by the `invite_for` expiry period as explained in the gem's documentation: + https://github.com/scambra/devise_invitable#model-configuration- + + > `invite_for`: The period the generated invitation token is valid. + After this period, the invited resource won’t be able to accept the + invitation. When `invite_for` is `0` (the default), the invitation won’t expire. + + Decidim sets this configuration to `2.weeks` so this configuration + should be respected: + https://github.com/decidim/decidim/blob/d2d390578050772d1bdb6d731395f1afc39dcbfc/decidim-core/config/initializers/devise.rb#L134 + + The bug is in the `devise_invitable` gem and should be fixed there + and the dependency should be upgraded in Decidim once the fix becomes available. + + ### Patches + + Update `devise_invitable` to version `2.0.9` or above by running the following command: + + ``` + $ bundle update devise_invitable + ``` + + ### Workarounds + + The invitations can be cancelled directly from the database by + running the following command from the Rails console: + + ``` + > Decidim::User.invitation_not_accepted.update_all(invitation_token: nil) + ``` + + ### References + + OWASP ASVS V4.0.3-2.3.1 + + This bug has existed in the `devise_invitable` gem since this commit + which was first included in the `v0.4.rc3` release of this gem: + https://github.com/scambra/devise_invitable/commit/94d859c7de0829bf63f679ae5dd3cab2b866a098 + + All versions since then are affected. + + This gem was first introduced at its version `~> 1.7.0` to the + `decidim-admin` gem in this commit which was first included in + the `v0.0.1.alpha3` release of Decidim: + https://github.com/decidim/decidim/commit/073e60e2e4224dd81815a784002ebba30f2ebb34 + + It was first introduced at its version `~> 1.7.0` to the `decidim-system` + gem in this commit which was also first included in the `v0.0.1.alpha3` + release of Decidim: + https://github.com/decidim/decidim/commit/b12800717a689c295a9ea680a38ca9f823d2c454 + + ### Credits + + This issue was discovered in City of Helsinki's security audit against + Decidim 0.27 done during September 2023. The security audit was + implemented by [Deloitte Finland](https://www2.deloitte.com/fi/fi.html). +cvss_v3: 5.7 +unaffected_versions: + - "< 0.0.1.alpha3" +patched_versions: + - "~> 0.26.9" + - ">= 0.27.5" +related: + url: + - https://nvd.nist.gov/vuln/detail/CVE-2023-48220 + - https://github.com/decidim/decidim/releases/tag/v0.26.9 + - https://github.com/decidim/decidim/releases/tag/v0.27.5 + - https://github.com/decidim/decidim/releases/tag/v0.28.0 + - https://github.com/decidim/decidim/security/advisories/GHSA-w3q8-m492-4pwp + - https://github.com/decidim/decidim/commit/073e60e2e4224dd81815a784002ebba30f2ebb34 + - https://github.com/decidim/decidim/commit/b12800717a689c295a9ea680a38ca9f823d2c454 + - https://github.com/scambra/devise_invitable/commit/94d859c7de0829bf63f679ae5dd3cab2b866a098 + - https://github.com/decidim/decidim/blob/d2d390578050772d1bdb6d731395f1afc39dcbfc/decidim-core/config/initializers/devise.rb#L134 + - https://github.com/scambra/devise_invitable/blob/41f58970ff76fb64382a9b9ea1bd530f7c3adab2/lib/devise_invitable/models.rb#L198 + - https://github.com/advisories/GHSA-w3q8-m492-4pwp diff --git a/gems/decidim-core/CVE-2023-51447.yml b/gems/decidim-core/CVE-2023-51447.yml new file mode 100644 index 0000000000..e203b8aa04 --- /dev/null +++ b/gems/decidim-core/CVE-2023-51447.yml @@ -0,0 +1,48 @@ +--- +gem: decidim-core +cve: 2023-51447 +ghsa: 9w99-78rj-hmxq +url: https://github.com/decidim/decidim/security/advisories/GHSA-9w99-78rj-hmxq +title: Cross-site scripting (XSS) in the dynamic file uploads +date: 2024-02-20 +description: | + ### Impact + The dynamic file upload feature is subject to potential XSS attach in case the attacker manages to modify the file names of the records being uploaded to the server. + + This appears in sections where the user controls the file upload dialogs themselves and has the technical knowledge to change the file names through the dynamic upload endpoint. Therefore I believe it would require the attacker to control the whole session of the particular user but in any case, this needs to be fixed. + + Successful exploit of this vulneratibility would require the user to have successfully uploaded a file blob to the server with a malicious file name and then have the possibility to direct the other user to the edit page of the record where the attachment is attached. + + The users are able to craft the direct upload requests themselves controlling the file name that gets stored to the database as shown here: + https://github.com/rails/rails/blob/a967d355c6fee9ad9b8bd115d43bc8b0fc207e7e/activestorage/app/controllers/active_storage/direct_uploads_controller.rb#L14 + + The attacker is able to change the filename e.g. to `` if they know how to craft these requests themselves. And then enter the returned blob ID to the form inputs manually by modifying the edit page source. + + Therefore, anywhere we display these strings, we should properly escape them. + + ### Patches + PR #11612 fixes this problem both for 0.28.dev and 0.27.x. + + ### Workarounds + Disable dynamic uploads for the instance, e.g. from proposals. + + ### References + OWASP ASVS v4.0.3-5.1.3 + + ### Credits + This issue was discovered in City of Helsinki's security audit against Decidim 0.27 done during September 2023. The security audit was implemented by [Deloitte Finland](https://www2.deloitte.com/fi/fi.html). +cvss_v3: 6.3 +unaffected_versions: + - "< 0.27.0" +patched_versions: + - ">= 0.27.5" +related: + url: + - https://github.com/decidim/decidim/security/advisories/GHSA-9w99-78rj-hmxq + - https://nvd.nist.gov/vuln/detail/CVE-2023-51447 + - https://github.com/decidim/decidim/pull/11612 + - https://github.com/decidim/decidim/commit/aaf72787cf18beeeb6a771c1f7cbb7654b073423 + - https://github.com/decidim/decidim/releases/tag/v0.27.5 + - https://github.com/decidim/decidim/releases/tag/v0.28.0 + - https://github.com/rails/rails/blob/a967d355c6fee9ad9b8bd115d43bc8b0fc207e7e/activestorage/app/controllers/active_storage/direct_uploads_controller.rb#L14 + - https://github.com/advisories/GHSA-9w99-78rj-hmxq diff --git a/gems/decidim-system/CVE-2023-48220.yml b/gems/decidim-system/CVE-2023-48220.yml new file mode 100644 index 0000000000..8612aa9968 --- /dev/null +++ b/gems/decidim-system/CVE-2023-48220.yml @@ -0,0 +1,73 @@ +--- +gem: decidim-system +cve: 2023-48220 +ghsa: w3q8-m492-4pwp +url: https://github.com/decidim/decidim/security/advisories/GHSA-w3q8-m492-4pwp +title: Possibility to circumvent the invitation token expiry period +date: 2024-02-20 +description: | + ### Impact + The invites feature allows users to accept the invitation for an unlimited amount of time through the password reset functionality. + + When using the password reset functionality, the `devise_invitable` gem always accepts the pending invitation if the user has been invited as shown in this piece of code within the `devise_invitable` gem: + https://github.com/scambra/devise_invitable/blob/41f58970ff76fb64382a9b9ea1bd530f7c3adab2/lib/devise_invitable/models.rb#L198 + + The only check done here is if the user has been invited but the code does not ensure that the pending invitation is still valid as defined by the `invite_for` expiry period as explained in the gem's documentation: + https://github.com/scambra/devise_invitable#model-configuration- + + > `invite_for`: The period the generated invitation token is valid. After this period, the invited resource won’t be able to accept the invitation. When `invite_for` is `0` (the default), the invitation won’t expire. + + Decidim sets this configuration to `2.weeks` so this configuration should be respected: + https://github.com/decidim/decidim/blob/d2d390578050772d1bdb6d731395f1afc39dcbfc/decidim-core/config/initializers/devise.rb#L134 + + The bug is in the `devise_invitable` gem and should be fixed there and the dependency should be upgraded in Decidim once the fix becomes available. + + ### Patches + Update `devise_invitable` to version `2.0.9` or above by running the following command: + + ``` + $ bundle update devise_invitable + ``` + + ### Workarounds + The invitations can be cancelled directly from the database by running the following command from the Rails console: + + ``` + > Decidim::User.invitation_not_accepted.update_all(invitation_token: nil) + ``` + + ### References + OWASP ASVS V4.0.3-2.3.1 + + This bug has existed in the `devise_invitable` gem since this commit which was first included in the `v0.4.rc3` release of this gem: + https://github.com/scambra/devise_invitable/commit/94d859c7de0829bf63f679ae5dd3cab2b866a098 + + All versions since then are affected. + + This gem was first introduced at its version `~> 1.7.0` to the `decidim-admin` gem in this commit which was first included in the `v0.0.1.alpha3` release of Decidim: + https://github.com/decidim/decidim/commit/073e60e2e4224dd81815a784002ebba30f2ebb34 + + It was first introduced at its version `~> 1.7.0` to the `decidim-system` gem in this commit which was also first included in the `v0.0.1.alpha3` release of Decidim: + https://github.com/decidim/decidim/commit/b12800717a689c295a9ea680a38ca9f823d2c454 + + ### Credits + This issue was discovered in City of Helsinki's security audit against Decidim 0.27 done during September 2023. The security audit was implemented by [Deloitte Finland](https://www2.deloitte.com/fi/fi.html). +cvss_v3: 5.7 +unaffected_versions: + - "< 0.0.1.alpha3" +patched_versions: + - "~> 0.26.9" + - ">= 0.27.5" +related: + url: + - https://github.com/decidim/decidim/security/advisories/GHSA-w3q8-m492-4pwp + - https://nvd.nist.gov/vuln/detail/CVE-2023-48220 + - https://github.com/decidim/decidim/commit/073e60e2e4224dd81815a784002ebba30f2ebb34 + - https://github.com/decidim/decidim/commit/b12800717a689c295a9ea680a38ca9f823d2c454 + - https://github.com/scambra/devise_invitable/commit/94d859c7de0829bf63f679ae5dd3cab2b866a098 + - https://github.com/decidim/decidim/blob/d2d390578050772d1bdb6d731395f1afc39dcbfc/decidim-core/config/initializers/devise.rb#L134 + - https://github.com/decidim/decidim/releases/tag/v0.26.9 + - https://github.com/decidim/decidim/releases/tag/v0.27.5 + - https://github.com/decidim/decidim/releases/tag/v0.28.0 + - https://github.com/scambra/devise_invitable/blob/41f58970ff76fb64382a9b9ea1bd530f7c3adab2/lib/devise_invitable/models.rb#L198 + - https://github.com/advisories/GHSA-w3q8-m492-4pwp diff --git a/gems/decidim-templates/CVE-2023-47635.yml b/gems/decidim-templates/CVE-2023-47635.yml new file mode 100644 index 0000000000..f2cdc6a226 --- /dev/null +++ b/gems/decidim-templates/CVE-2023-47635.yml @@ -0,0 +1,42 @@ +--- +gem: decidim-templates +cve: 2023-47635 +ghsa: f3qm-vfc3-jg6v +url: https://github.com/decidim/decidim/security/advisories/GHSA-f3qm-vfc3-jg6v +title: Possible CSRF attack at questionnaire templates preview +date: 2024-02-20 +description: | + ### 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 +cvss_v3: 4.5 +unaffected_versions: + - "< 0.23.0" +patched_versions: + - ">= 0.27.5" +related: + url: + - https://github.com/decidim/decidim/security/advisories/GHSA-f3qm-vfc3-jg6v + - https://github.com/decidim/decidim/pull/11743 + - https://nvd.nist.gov/vuln/detail/CVE-2023-47635 + - https://github.com/decidim/decidim/pull/6247 + - https://github.com/decidim/decidim/commit/5542227be66e3b6d7530f5b536069bce09376660 + - https://github.com/decidim/decidim/commit/57a4b467787448307b5d9b01ce6e2c8502e121ac + - https://github.com/decidim/decidim/blob/3187bdfd40ea1c57c2c12512b09a7fec0b2bed08/decidim-templates/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb#L11 + - https://github.com/decidim/decidim/releases/tag/v0.27.5 + - https://github.com/decidim/decidim/releases/tag/v0.28.0 + - https://github.com/advisories/GHSA-f3qm-vfc3-jg6v diff --git a/gems/decidim/CVE-2023-47634.yml b/gems/decidim/CVE-2023-47634.yml new file mode 100644 index 0000000000..6d56adc542 --- /dev/null +++ b/gems/decidim/CVE-2023-47634.yml @@ -0,0 +1,24 @@ +--- +gem: decidim +cve: 2023-47634 +ghsa: r275-j57c-7mf2 +url: https://github.com/decidim/decidim/security/advisories/GHSA-r275-j57c-7mf2 +title: Race condition in Endorsements +date: 2024-02-20 +description: | + "### Impact\n\nA race condition in the endorsement of resources (for + instance, a proposal) allows a user to make more than once endorsement.\n\nTo exploit + this vulnerability, the request to set an endorsement must be sent several times + in parallel.\n \n### Workarounds\n\nDisable the Endorsement feature in the components. " +cvss_v3: 3.1 +unaffected_versions: + - "< 0.10.0" +patched_versions: + - "~> 0.26.9" + - ">= 0.27.5" +related: + url: + - https://github.com/decidim/decidim/security/advisories/GHSA-r275-j57c-7mf2 + - https://github.com/decidim/decidim/commit/5c5ee7a50d75c10643dd8c495e2517641e4d74db + - https://github.com/decidim/decidim/commit/7b840d2c37a562709f4481db644d8c43add28536 + - https://github.com/advisories/GHSA-r275-j57c-7mf2 diff --git a/gems/decidim/CVE-2023-48220.yml b/gems/decidim/CVE-2023-48220.yml new file mode 100644 index 0000000000..83b3963dbf --- /dev/null +++ b/gems/decidim/CVE-2023-48220.yml @@ -0,0 +1,73 @@ +--- +gem: decidim +cve: 2023-48220 +ghsa: w3q8-m492-4pwp +url: https://github.com/decidim/decidim/security/advisories/GHSA-w3q8-m492-4pwp +title: Possibility to circumvent the invitation token expiry period +date: 2024-02-20 +description: | + ### Impact + The invites feature allows users to accept the invitation for an unlimited amount of time through the password reset functionality. + + When using the password reset functionality, the `devise_invitable` gem always accepts the pending invitation if the user has been invited as shown in this piece of code within the `devise_invitable` gem: + https://github.com/scambra/devise_invitable/blob/41f58970ff76fb64382a9b9ea1bd530f7c3adab2/lib/devise_invitable/models.rb#L198 + + The only check done here is if the user has been invited but the code does not ensure that the pending invitation is still valid as defined by the `invite_for` expiry period as explained in the gem's documentation: + https://github.com/scambra/devise_invitable#model-configuration- + + > `invite_for`: The period the generated invitation token is valid. After this period, the invited resource won’t be able to accept the invitation. When `invite_for` is `0` (the default), the invitation won’t expire. + + Decidim sets this configuration to `2.weeks` so this configuration should be respected: + https://github.com/decidim/decidim/blob/d2d390578050772d1bdb6d731395f1afc39dcbfc/decidim-core/config/initializers/devise.rb#L134 + + The bug is in the `devise_invitable` gem and should be fixed there and the dependency should be upgraded in Decidim once the fix becomes available. + + ### Patches + Update `devise_invitable` to version `2.0.9` or above by running the following command: + + ``` + $ bundle update devise_invitable + ``` + + ### Workarounds + The invitations can be cancelled directly from the database by running the following command from the Rails console: + + ``` + > Decidim::User.invitation_not_accepted.update_all(invitation_token: nil) + ``` + + ### References + OWASP ASVS V4.0.3-2.3.1 + + This bug has existed in the `devise_invitable` gem since this commit which was first included in the `v0.4.rc3` release of this gem: + https://github.com/scambra/devise_invitable/commit/94d859c7de0829bf63f679ae5dd3cab2b866a098 + + All versions since then are affected. + + This gem was first introduced at its version `~> 1.7.0` to the `decidim-admin` gem in this commit which was first included in the `v0.0.1.alpha3` release of Decidim: + https://github.com/decidim/decidim/commit/073e60e2e4224dd81815a784002ebba30f2ebb34 + + It was first introduced at its version `~> 1.7.0` to the `decidim-system` gem in this commit which was also first included in the `v0.0.1.alpha3` release of Decidim: + https://github.com/decidim/decidim/commit/b12800717a689c295a9ea680a38ca9f823d2c454 + + ### Credits + This issue was discovered in City of Helsinki's security audit against Decidim 0.27 done during September 2023. The security audit was implemented by [Deloitte Finland](https://www2.deloitte.com/fi/fi.html). +cvss_v3: 5.7 +unaffected_versions: + - "< 0.0.1.alpha3" +patched_versions: + - "~> 0.26.9" + - ">= 0.27.5" +related: + url: + - https://github.com/decidim/decidim/security/advisories/GHSA-w3q8-m492-4pwp + - https://nvd.nist.gov/vuln/detail/CVE-2023-48220 + - https://github.com/decidim/decidim/commit/073e60e2e4224dd81815a784002ebba30f2ebb34 + - https://github.com/decidim/decidim/commit/b12800717a689c295a9ea680a38ca9f823d2c454 + - https://github.com/scambra/devise_invitable/commit/94d859c7de0829bf63f679ae5dd3cab2b866a098 + - https://github.com/decidim/decidim/blob/d2d390578050772d1bdb6d731395f1afc39dcbfc/decidim-core/config/initializers/devise.rb#L134 + - https://github.com/decidim/decidim/releases/tag/v0.26.9 + - https://github.com/decidim/decidim/releases/tag/v0.27.5 + - https://github.com/decidim/decidim/releases/tag/v0.28.0 + - https://github.com/scambra/devise_invitable/blob/41f58970ff76fb64382a9b9ea1bd530f7c3adab2/lib/devise_invitable/models.rb#L198 + - https://github.com/advisories/GHSA-w3q8-m492-4pwp diff --git a/gems/decidim/CVE-2023-51447.yml b/gems/decidim/CVE-2023-51447.yml new file mode 100644 index 0000000000..bedd6ff455 --- /dev/null +++ b/gems/decidim/CVE-2023-51447.yml @@ -0,0 +1,48 @@ +--- +gem: decidim +cve: 2023-51447 +ghsa: 9w99-78rj-hmxq +url: https://github.com/decidim/decidim/security/advisories/GHSA-9w99-78rj-hmxq +title: Cross-site scripting (XSS) in the dynamic file uploads +date: 2024-02-20 +description: | + ### Impact + The dynamic file upload feature is subject to potential XSS attach in case the attacker manages to modify the file names of the records being uploaded to the server. + + This appears in sections where the user controls the file upload dialogs themselves and has the technical knowledge to change the file names through the dynamic upload endpoint. Therefore I believe it would require the attacker to control the whole session of the particular user but in any case, this needs to be fixed. + + Successful exploit of this vulneratibility would require the user to have successfully uploaded a file blob to the server with a malicious file name and then have the possibility to direct the other user to the edit page of the record where the attachment is attached. + + The users are able to craft the direct upload requests themselves controlling the file name that gets stored to the database as shown here: + https://github.com/rails/rails/blob/a967d355c6fee9ad9b8bd115d43bc8b0fc207e7e/activestorage/app/controllers/active_storage/direct_uploads_controller.rb#L14 + + The attacker is able to change the filename e.g. to `` if they know how to craft these requests themselves. And then enter the returned blob ID to the form inputs manually by modifying the edit page source. + + Therefore, anywhere we display these strings, we should properly escape them. + + ### Patches + PR #11612 fixes this problem both for 0.28.dev and 0.27.x. + + ### Workarounds + Disable dynamic uploads for the instance, e.g. from proposals. + + ### References + OWASP ASVS v4.0.3-5.1.3 + + ### Credits + This issue was discovered in City of Helsinki's security audit against Decidim 0.27 done during September 2023. The security audit was implemented by [Deloitte Finland](https://www2.deloitte.com/fi/fi.html). +cvss_v3: 6.3 +unaffected_versions: + - "< 0.27.0" +patched_versions: + - ">= 0.27.5" +related: + url: + - https://github.com/decidim/decidim/security/advisories/GHSA-9w99-78rj-hmxq + - https://nvd.nist.gov/vuln/detail/CVE-2023-51447 + - https://github.com/decidim/decidim/pull/11612 + - https://github.com/decidim/decidim/commit/aaf72787cf18beeeb6a771c1f7cbb7654b073423 + - https://github.com/decidim/decidim/releases/tag/v0.27.5 + - https://github.com/decidim/decidim/releases/tag/v0.28.0 + - https://github.com/rails/rails/blob/a967d355c6fee9ad9b8bd115d43bc8b0fc207e7e/activestorage/app/controllers/active_storage/direct_uploads_controller.rb#L14 + - https://github.com/advisories/GHSA-9w99-78rj-hmxq diff --git a/gems/devise_invitable/CVE-2023-48220.yml b/gems/devise_invitable/CVE-2023-48220.yml new file mode 100644 index 0000000000..d4786cdffa --- /dev/null +++ b/gems/devise_invitable/CVE-2023-48220.yml @@ -0,0 +1,72 @@ +--- +gem: devise_invitable +cve: 2023-48220 +ghsa: w3q8-m492-4pwp +url: https://github.com/decidim/decidim/security/advisories/GHSA-w3q8-m492-4pwp +title: Possibility to circumvent the invitation token expiry period +date: 2024-02-20 +description: | + ### Impact + The invites feature allows users to accept the invitation for an unlimited amount of time through the password reset functionality. + + When using the password reset functionality, the `devise_invitable` gem always accepts the pending invitation if the user has been invited as shown in this piece of code within the `devise_invitable` gem: + https://github.com/scambra/devise_invitable/blob/41f58970ff76fb64382a9b9ea1bd530f7c3adab2/lib/devise_invitable/models.rb#L198 + + The only check done here is if the user has been invited but the code does not ensure that the pending invitation is still valid as defined by the `invite_for` expiry period as explained in the gem's documentation: + https://github.com/scambra/devise_invitable#model-configuration- + + > `invite_for`: The period the generated invitation token is valid. After this period, the invited resource won’t be able to accept the invitation. When `invite_for` is `0` (the default), the invitation won’t expire. + + Decidim sets this configuration to `2.weeks` so this configuration should be respected: + https://github.com/decidim/decidim/blob/d2d390578050772d1bdb6d731395f1afc39dcbfc/decidim-core/config/initializers/devise.rb#L134 + + The bug is in the `devise_invitable` gem and should be fixed there and the dependency should be upgraded in Decidim once the fix becomes available. + + ### Patches + Update `devise_invitable` to version `2.0.9` or above by running the following command: + + ``` + $ bundle update devise_invitable + ``` + + ### Workarounds + The invitations can be cancelled directly from the database by running the following command from the Rails console: + + ``` + > Decidim::User.invitation_not_accepted.update_all(invitation_token: nil) + ``` + + ### References + OWASP ASVS V4.0.3-2.3.1 + + This bug has existed in the `devise_invitable` gem since this commit which was first included in the `v0.4.rc3` release of this gem: + https://github.com/scambra/devise_invitable/commit/94d859c7de0829bf63f679ae5dd3cab2b866a098 + + All versions since then are affected. + + This gem was first introduced at its version `~> 1.7.0` to the `decidim-admin` gem in this commit which was first included in the `v0.0.1.alpha3` release of Decidim: + https://github.com/decidim/decidim/commit/073e60e2e4224dd81815a784002ebba30f2ebb34 + + It was first introduced at its version `~> 1.7.0` to the `decidim-system` gem in this commit which was also first included in the `v0.0.1.alpha3` release of Decidim: + https://github.com/decidim/decidim/commit/b12800717a689c295a9ea680a38ca9f823d2c454 + + ### Credits + This issue was discovered in City of Helsinki's security audit against Decidim 0.27 done during September 2023. The security audit was implemented by [Deloitte Finland](https://www2.deloitte.com/fi/fi.html). +cvss_v3: 5.7 +unaffected_versions: + - "< 0.4.rc3" +patched_versions: + - ">= 2.0.9" +related: + url: + - https://github.com/decidim/decidim/security/advisories/GHSA-w3q8-m492-4pwp + - https://nvd.nist.gov/vuln/detail/CVE-2023-48220 + - https://github.com/decidim/decidim/commit/073e60e2e4224dd81815a784002ebba30f2ebb34 + - https://github.com/decidim/decidim/commit/b12800717a689c295a9ea680a38ca9f823d2c454 + - https://github.com/scambra/devise_invitable/commit/94d859c7de0829bf63f679ae5dd3cab2b866a098 + - https://github.com/decidim/decidim/blob/d2d390578050772d1bdb6d731395f1afc39dcbfc/decidim-core/config/initializers/devise.rb#L134 + - https://github.com/decidim/decidim/releases/tag/v0.26.9 + - https://github.com/decidim/decidim/releases/tag/v0.27.5 + - https://github.com/decidim/decidim/releases/tag/v0.28.0 + - https://github.com/scambra/devise_invitable/blob/41f58970ff76fb64382a9b9ea1bd530f7c3adab2/lib/devise_invitable/models.rb#L198 + - https://github.com/advisories/GHSA-w3q8-m492-4pwp From a75122a658bc7122c7ee7fddb10654f3518bc9ba Mon Sep 17 00:00:00 2001 From: Al Snow Date: Tue, 27 Feb 2024 07:39:33 -0500 Subject: [PATCH 2/2] GHSA Sync: 1 brand new advisory --- gems/rack-cors/CVE-2024-27456.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gems/rack-cors/CVE-2024-27456.yml diff --git a/gems/rack-cors/CVE-2024-27456.yml b/gems/rack-cors/CVE-2024-27456.yml new file mode 100644 index 0000000000..1b481e3344 --- /dev/null +++ b/gems/rack-cors/CVE-2024-27456.yml @@ -0,0 +1,16 @@ +--- +gem: rack-cors +cve: 2024-27456 +ghsa: 785g-282q-pwvx +url: https://github.com/advisories/GHSA-785g-282q-pwvx +title: Rack CORS Middleware has Insecure File Permissions +date: 2024-02-26 +description: | + rack-cors (aka Rack CORS Middleware) 2.0.1 has 0666 permissions + for the .rb files. +notes: Never patched +related: + url: + - https://nvd.nist.gov/vuln/detail/CVE-2024-27456 + - https://github.com/cyu/rack-cors/issues/274 + - https://github.com/advisories/GHSA-785g-282q-pwvx