Update module project updates will not update Composer dependencies for security updates

Created on 29 August 2023, about 1 year ago
Updated 8 April 2024, 8 months ago

Originally reported to the Drupal security team by @tedbow on 9 May 2022 (#176856), which was subsequently considered a case for security hardening and not a vulnerability.

Problem/Motivation

This module has a Update vulnerability.

The Update existing functionality around installing and update functionality

The installing problem where if a site is comprised any unsafe module could be installed via URL has been publicly documented , probably many places.

But there is another problem because module updates are not Composer-aware.

Example security problem:

  1. A contrib Module X has security update because 1 of it's Composer dependencies has a security update
  2. The Composer dependency security update only has the security fix and no BC breaks so the Drupal site will still work if the dependency is not updated(though it will be insecure)
  3. User sees the security update in admin/reports/updates/update
  4. User updates the Module X via the UI
  5. The Composer dependency with the security update is not updated because the Update module does not update Composer dependencies
  6. The user thinks they have fixed the security problem on their site but they have not and will have no indication they have not unless they read the release notes

This is very obvious but I am not sure we have this documented anywhere.

It would actually be a way to mass exploit sites after contrib security update that just updates a dependency for a security updates. For instance if a very popular contrib module with a Composer dependency had a security update for the dependencies security update then an attacker could not only search for sites that have not yet updated they could also search for sites that updated via the Update module.

I am filing this issue because I think the above problem is a good reason to disable the Update module non-Composer aware updating by default in Drupal 10 even before Automatic Updates has a replacement. But I am not sure if I should make that point publically in the issue.

---
Follow-up comments by tedbow:
9 May 2022 at 23:18

There are a lot ways we could address this problem here is my suggestion

  1. Implentent. Default `allow_authorize_operations` to false to discourage installing and updating modules in Composer incompatible ways . This would mean in Drupal 10 you would have to opt-in to updating and installing modules via the UI in a way that is not Composer compatible
  2. In the #$settings['allow_authorize_operations'] comment in settings.php indicate that if you change the default setting you will have to either ensure you are not using any modules with Composer dependencies or do updates that change Composer dependencies via Composer(I am sure this is actual practical to use both)
  3. Add a warning to the UI that allows updates admin/reports/updates/update(if default is disabling is overridden) that using the form requires you to manually keep Composer dependencies up-to-date. We could only put the message if there are security updates but I think #5 demonstrates it is actually more complicated
  4. Add link to Available Updates, admin/reports/updates, to documentation about how to update projects. The suggested method would be Composer but we could document how to override $settings['allow_authorize_operations'] and document the problems with dependencies, security and otherwise, this could lead to

Outside of core to make the upgrade to Drupal 10 easier we could also add a check in Upgrade Status to check if contrib projects are present the codebase that are not known to Composer or the version numbers do not match what Composer has. This would likely indicate the site has been using Update module functionality to install and/or update modules. Then we could provide a warning that you should consider using Composer or if you still want use the Update module to update/install you can override $settings['allow_authorize_operations']

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Contributors

- tedbow
- DamienMcKenna
- effulgentsia
- dww
- cilefen
- xjm
- catch

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Update 

Last updated about 6 hours ago

  • Maintained by
  • 🇺🇸United States @tedbow
  • 🇺🇸United States @dww
Created by

🇳🇱Netherlands dokumori Utrecht

Live updates comments and jobs are added and updated live.
  • Security

    It is used for security vulnerabilities which do not need a security advisory. For example, security issues in projects which do not have security advisory coverage, or forward-porting a change already disclosed in a security advisory. See Drupal’s security advisory policy for details. Be careful publicly disclosing security vulnerabilities! Use the “Report a security vulnerability” link in the project page’s sidebar. See how to report a security issue for details.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024