Problem/Motivation

This issue began in 2017 with reporting that in #2804155: If the next minor version of core has a security release, status still says "Security update required!" even if the site is on an equivalent, secure release already, we discovered badly-outdated sites offer up all the security updates. That change meant that every security release was listed on the 'Available updates' page and the user was presented with an overwhelming set of choices. See original image.

In #17 this was reported fixed and this issue is to add test coverage so that doesn't happen again.

To test the fix, one can change the VERSION constant in Drupal.php to 8.1.10, which is used in the 'original image' and compare the results.

Proposed resolution

TBD
Possible solutions:

Remaining tasks

Items in #32
Add test case

User interface changes

API changes

Data model changes

Issue fork drupal-2865920

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

drumm created an issue. See original summary.

drumm’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new1.46 KB
drumm’s picture

StatusFileSize
new1.47 KB

This may only be relevant when we get to 9.0.x, but there was a key collision with numeric keys. This patch adds the 'sec-' prefix to $key.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

xjm’s picture

I don't think this is the right approach. Sometimes we will have joint releases, like 8.2.8 and 8.3.1. So in that case 8.3.1 is equivalent from a security perspective. A couple months later 8.3.4 ccomes out with a new security fix that is not backprted to 8.2.x, so 8.3.1 is then insecure.

I think what we should actually be showing is just the latest security release on that branch and the latest security release on subsequent branches. Or something.

David_Rothstein’s picture

Status: Needs review » Needs work

There is documentation in https://api.drupal.org/api/drupal/core%21modules%21update%21update.compa... that explains the justification for the current behavior:

Finally, and most importantly, the release history continues to be scanned until the currently installed release is reached, searching for anything marked as a security update. If any security updates have been found between the recommended release and the installed version, all of the releases that included a security fix are recorded so that the site administrator can be warned their site is insecure, and links pointing to the release notes for each security update can be included (which, in turn, will link to the official security announcements for each vulnerability).

Personally I agree with that reasoning, so I don't think all the non-up-to-date security releases should be removed completely.

That said, the old ones definitely don't need to take up so much screen space (with download links and the whole rigmarole). I could definitely imagine it being streamlined down to a single line, something like "Previous security releases: X, Y, Z..." where each one is just a simple link to the release notes.

xjm’s picture

Title: Show only the most-recent security updates » When a site is multiple security releases behind for a project, list the releases in a single "Security update required!" row, rather than a paralyzing wall of terror

That said, the old ones definitely don't need to take up so much screen space (with download links and the whole rigmarole). I could definitely imagine it being streamlined down to a single line, something like "Previous security releases: X, Y, Z..." where each one is just a simple link to the release notes.

Good point, this makes sense. Retitling to that scope. Also going to add an annotated screenshot so that I don't continue to confuse this with all the things.

xjm’s picture

Title: When a site is multiple security releases behind for a project, list the releases in a single "Security update required!" row, rather than a paralyzing wall of terror » When a site is multiple security releases behind for a given project, they are all listed in a paralyzing wall of terror

Actually, retitling to the bug rather than a proposed resolutiton

xjm’s picture

So hm, OTOH. For non-security releases, we don't list all the releases. We only list the latest one. The site owner probably still needs to know the things in the intervening release notes. If you're on 8.3.7 and planning to update to 8.5.1, you probably should review both the 8.4.0 and 8.5.0 release notes.

xjm’s picture

Issue summary: View changes
Issue tags: +Usability
StatusFileSize
new130.07 KB

This is probably another thing that we should have design/usability work for, rather than three backend developers trying to decide what to do with a UI. :)

Anyway here's the screenshot so I understand/rememebr which issue this is, and separating the problem statement from the proposed resolution in the IS.

xjm’s picture

So yeah, I don't think we should link all the releases because we don't want the user to choose one of the releases and install them. We want them to install the latest security release.

Maybe what we should do instead is add a one-liner to our security release notes template that is something like:

See all past security advisories for this project.

xjm’s picture

Issue tags: +Needs usability review

Tagging for design/UX feedback.

cilefen’s picture

Perhaps a wall of scary red will encourage upgrading? I just don’t understand how a site owner could see that and not jump to action.

That said, don’t we want to highlight the security release higher than the installed version that is on a supported branch?

dww’s picture

Perhaps a wall of scary red will encourage upgrading? I just don’t understand how a site owner could see that and not jump to action.

That was indeed the intention of the original design + implementation. ;)

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

xjm’s picture

So this issue is resolved now. Since @drumm marked old releases "insecure" for #2804155: If the next minor version of core has a security release, status still says "Security update required!" even if the site is on an equivalent, secure release already, only the latest security update is shown. This can be tested by installing Drupal 8.1.0 and checking the update status report.

We should use this issue to add test coverage for it.

xjm’s picture

Category: Feature request » Task

I think a way to address this:

If any security updates have been found between the recommended release and the installed version, all of the releases that included a security fix are recorded so that the site administrator can be warned their site is insecure, and links pointing to the release notes for each security update can be included (which, in turn, will link to the official security announcements for each vulnerability).

Would be to instead just add a link to https://www.drupal.org/security?

drumm’s picture

Release pages on drupal.org also now have links to other releases in the series in the bottom-right. For example, https://www.drupal.org/project/drupal/releases/8.5.6 has links to all 8.x releases. We could add some indication of security releases and/or insecure releases. Not something to rely on since the bottom-right of websites is often ignored, but it’s something.

dyannenova’s picture

I think the link in #12 could be helpful, although it won't give the reader clear feedback on which of those advisories applied to their own site.

It seems like the actual goal for #18 is to have a place that the reader can see all of the advisories that apply to their site, in one place. But I feel like that's outside of the scope of this issue, and could be a follow up. Only showing the latest release is much better for the user than showing a wall of releases with the possibility that the user will install the wrong one.

xjm’s picture

In #2990511: Add comprehensive test coverage for update status for security releases @tedbow identified that the site can show older security releases than the site's currently installed version, which is definitely not the right behavior. @tedbow filed #2992631: Update report incorrectly recommends security releases for old minors when a security update is needed and a secure version of the old minor is also available for that, though it will probably end up being fixed by whatever's left to fix here following the d.o metadata change. @tedbow has a couple test cases for instances that still show multiple releases and will attach them here for now.

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new5.17 KB
new699 bytes
  1. re the solution in #3
    +++ b/core/modules/update/update.report.inc
    @@ -168,12 +168,18 @@ function template_preprocess_update_project_status(&$variables) {
    -          $versions_inner[] = [
    -            '#theme' => 'update_version',
    -            '#version' => $security_update,
    -            '#title' => t('Security update:'),
    -            '#attributes' => ['class' => $security_class],
    -          ];
    +          // Show only the latest security update for the series. For core, the
    +          // series is the minor version (8.1.x vs. 8.2.x). For other projects,
    +          // this is the major version, (8.x-1.x vs. 8.x-2.x).
    +          $key = 'sec-' . $security_update[$project['project_type'] === 'core' ? 'version_minor' : 'version_major'];
    +          if (!isset($versions_inner[$key]) || version_compare($security_update['version'], $versions_inner[$key]['#version']['version']) === 1) {
    

    I don't think we should be solving this on the return template level.

    I think update_calculate_project_update_status() tries to solve this and should be the authority on what security updates are applicable.

  2. as @xjm said in #21 some the metadata changes coming from drupal.org update xmls should fix a lot of this. Most previous security releases will have the Insecure tag because they contain security hole that was found in later security updates so they will be marked as insecure. So update_calculate_project_update_status() will no longer return them.
  3. This did not fix the case though of when you are on insecure version and Drupal was still showing you security releases that were themselves secure(i,e not tagged with Insecure) but they would be a downgrade from the sites current version.

    This is because in update_calculate_project_update_status() there is code to try stop looping through releases when we find the current version of project.

     // Stop searching once we hit the currently installed version.
     if ($project_data['existing_version'] === $version) {
       break;
     }
    

    This seems correct and should avoid showing any releases before the current version. But if we look a little above this

    // Otherwise, ignore unpublished, insecure, or unsupported releases.
        if ($release['status'] == 'unpublished' ||
            (isset($release['terms']['Release type']) &&
             (in_array('Insecure', $release['terms']['Release type']) ||
              in_array('Unsupported', $release['terms']['Release type'])))) {
          continue;
        }
    

    If the current release is insecure then we will continue; looping through releases and not reach the break; above to which should stop us from looping through prior releases.

    I will upload a fix for just this.

  4. I will also upload a patch with the test cases @xjm mentioned in #21 that will mostly pass with this fix.
  5. There is one test that will still fail.
    '8.x-3.0-beta1, 8.x-1.2 8.x-2.2' => [
         'module_patch_version' => '8.x-3.0-beta1',
         'expected_security_releases' => ['8.x-2.2'],
         'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
         'fixture' => 'sec.8.x-1.2_8.x-2.2',
     ],
    

    I am not sure what the correct behavior is here.

    In the fixture used for the test 8.x-3.0-beta1, the installed version, is tagged Insecure. 8.x-3.0-beta2 is not Insecure but is also not a Security update. This because pre-releases besides RC releases cannot marked Security updates.

    I think @xjm argued we should show the previous Security update 8.x-2.2 because the site is on an Insecure version and this the only available Security update.

    The problem of course is that this would downgrade. The fix above would have to be extended to show at least 1 previous security release. Also if 8.x-3.0-beta1 contain any non downgrade changes such as entity field additions or other table changes you site would likely break.

    The fix above recommend an upgrade 8.x-3.0-beta2 but this would not be label as a Security upgrade.

xjm’s picture

xjm’s picture

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

xjm’s picture

We determined previously that it's hard to resolve the other UX issues with the status report if this one isn't also solved, so explicitly adding it to the roadmap for the security coverage initiative.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

xjm’s picture

We should also re-test what happens with this issue now that Drupal.org has changed how insecure releases are handled: Does the wall of terror persist?

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tedbow’s picture

Issue summary: View changes
StatusFileSize
new71.33 KB
  1. Locally testing 9.2.0 should determine if this problem still exists. I test and this is what I see

    I think the problem is fixed but we should have test to confirm this doesn't happen again.

  2. we still have to decide what to do with #22.5

    in that case should we recommend 8.x-3.0-beta2 which is not security release but also not insecure

    or should we recommend 8.x-2.2 which is security release but it also a downgrade.

  3. We have a todo in \Drupal\Tests\update\Functional\UpdateContribTest::securityUpdateAvailabilityProvider() to add the missing test case mention above.

    We should start a new merge request with that test case which will now fail.

  4. Then we should look at changes if it is determined that 8.x-2.2 should be recommended.

    This would mean we would have to change update_calculate_project_update_status() to look for a security release that is less than current version

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

kunal.sachdev made their first commit to this issue’s fork.

phenaproxima’s picture

Since the original title of this issue no longer really applies, I think we should probably re-title this and update the issue summary. Tagging for those.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new150 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone made their first commit to this issue’s fork.

quietone’s picture

Title: When a site is multiple security releases behind for a given project, they are all listed in a paralyzing wall of terror » Add tests for when a single supported branch has 2 security updates that are both not insecure
Issue summary: View changes
Issue tags: -Needs issue summary update, -Needs title update

Issue Summary update and title change

quietone’s picture

Issue summary: View changes
Priority: Major » Normal
Status: Needs work » Needs review
StatusFileSize
new22.18 KB

#31
1. Already fixed.
2. Added test case and removed @todo in UpdateContribTest.
3. The MR for this is MR1615
4. Check if these results are what is wanted:

simohell’s picture

Issue tags: -Usability, -Needs usability review
StatusFileSize
new297.64 KB

Since 1. was her the part affecting usability and was fixed already and the remaining task for this ticket is the test, I'm removing "usability" and needs usability review" tags. If we need to look at the usability aspects of the message (such as order of the recommendations, security updates on each supported minor etc.) it should prbably be a new issue.

Attaching an example screnshot for 10.1.1 message for reference.

smustgrave made their first commit to this issue’s fork.

smustgrave changed the visibility of the branch 2865920-when-a-site to hidden.

smustgrave changed the visibility of the branch 2865920-when-a-site to active.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests +Needs Review Queue Initiative

Rebased and fixed phpcs issue
Hiding patches and old MR (but then un-hid_

Will remove tests tag as test branch is showing failure.

But can we update the MR 1594 for 11.x and include tests too please.

xjm’s picture

Unsure about the retitle and IS rewrite here. I am not sure the issue was totally fixed, just that it was mitigated by a recent change to d.o. The issue is still partly present AFAIK.

quietone’s picture

According to #32.1 this original problem is fixed. tedbow states that they tested on 9.2 and "I think the problem is fixed but we should have test to confirm this doesn't happen again".

simohell’s picture

As this was tagged, I had this queued for UX review meeting on May 10 but while preparing, I couldn't reproduce the original usability issue as it was already fixed as mentioned in #32. We didn't therefore do a formal review/recommendations and the related discussion is not included in the meeting recording.

quietone changed the visibility of the branch 2865920-test-without-patch to hidden.

quietone changed the visibility of the branch 2865920-test-without-patch to active.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.