Problem/Motivation

Over at https://www.drupal.org/docs/updating-drupal/responding-to-critical-secur... the JSON output does not track something like "versions_affected", so there is no way to, for example, ensure something like https://www.drupal.org/psa-2019-02-19 only shows up on 8.5.x and 8.6.x sites. There's data to back this up in the conversation at https://twitter.com/webchick/status/1362569962695446530 about adding this feature to System module.

The lack of this could result in site owners getting irrelevant notices, which they cannot shut off, and which could lead into either widespread ignoring of these messages, or widespread disabling of this feature, both of which work against our goal to increase Drupal's security.

Proposed resolution

Add some metadata in the JSON file to allow the core feature to only show messages that impact the installed core version.

Remaining tasks

1. Figure out if we should do this
2. Propose new JSON property/ies
3. Code it.
4. Update core feature to take advantage of it.

User interface changes

N/A

API changes

Yes.

Data model changes

Yes.

Comments

webchick created an issue. See original summary.

webchick’s picture

Issue tags: +Needs security review

We chatted about this in Slack in the thread at https://drupal.slack.com/archives/C7QJNEY3E/p1619714230411400.

@drumm would like security team sign-off before changing the API in any way, which is completely fair.

His main concern was that the more information you give about a forthcoming vulnerability, the more information attackers have to try and exploit it ahead of time.

This is true. However, we seem to give out that information freely on PSAs. Examples:

He also pointed out that in most cases, Drupal 8 / 9 and 9 / 10 security issues impact the other platforms (it's not the same as D7 vs. D8/9 which were two completely different code bases, effectively). This is also true. But yet, we continue to innovate in newer major versions of Drupal to add more features. Some of which might have security issues (in fact, newer code is arguably more likely to). An issue in Olivero theme is never going to impact D8 sites. Neither is a security issue in an API present in D8 that we removed in D9.

Why I'm pushing on this is that we know from user research at https://twitter.com/webchick/status/1362569962695446530 that the #1 reason people push back against a feature like this is their users getting irrelevant notices and this creating work for them. So it seems like an important consideration if we do not want people to shut this off en masse, thus severely hampering the benefit.

webchick’s picture

Issue summary: View changes
tedbow’s picture

  1. I wanted to point that if we add this metadata we don't have to use it on every security advisory.

    Just like the Security Team members are in charge now of creating the text in the advisories to determine what information is too much that might given away a vulnerability they would also be in charge adding this metadata or leaving it blank.

    For any advisory where the metadata is not specified Core could default to show the advisory

  2. I had 2 thoughts on how we might want specify this metadata.

    1) Just have major versions affected, the available choices would all major version of Drupal regardless of support(in case we want to push a security fix to major version that was just taken out of support but 10s of thousands of sites are still using
    2) A Composer constraint. For example for the release above that has "8.5.x and 8.6.x" in the text the metadata would have been ^8.5 || ^8.6

    Method 2 would give the most flexibility and even if the Security team wanted a policy of only ever specifying major versions they could still use this method. For example for 9 and 10 but not 8 you could use ^9 || ^10.

    Probably with the limited number of people who have access to the PSA form on drupal.org you could just have this be enforced by the writers but you could also limit the UI for the field to only show a multi-select of major versions and then translate that into the field value ^9 || ^10. This way though if the policy changed to allow specifying minor version you update the UI on the PSA form to and not need to make any changes to core.

tedbow’s picture

Wanted to paste in some of my thoughts from a slack thread with @drumm

@drumm I guess the problem I was trying to point out is.

  1. is probably unlikely but not impossible that there will be a d7 only PSA in the feed before EOL(18 months from now)
  2. If so, as the core patch is now all Drupal 8 + 9 (+10?) sites will see this D7 only message in UI
  3. It will be a message that they can’t get rid of
  4. The message will not be actionable or applicable to them

@drumm said thinks a D7 only PSA at this point is a near impossibility. I could definitely see why that would be the case because the d7 code base has been around for so long. But "near impossibility" is not impossible.

I think the big risk in this scenario is we have D7 only PSA all D8 and D9 sites seen this dire warning and some get annoyed and turn off this functionality and never see another PSA.

The solution though I suggested in #4 is a lot of work for a near impossibility.

Here is another idea:

  1. Core adds functionality to filter PSA's by a new field "version_constraint"
  2. Core would only evaluate this if it was not empty and is_psa === 1 and all other logic determines it should be shown to the site.
  3. Core would then see if the version constraint was a match for which project the PSA applied to.
  4. Core would add tests and json test fixtures to make sure this functionality would work and existing test fixtures without version_constraint also worked
  5. drupal.org makes no changes currently. If is deemed necessary to do this at a later date Drupal.org could add the functionality to set version_constraint

If 5) happens, say if there is Drupal 7 PSA that is forth coming drupal.org could handle it in different ways for example.:

  1. Do some form of my suggestion in #4
  2. Update drush_drupalorg_update_psa_json() which produces the PSAs to accept version_constraint. It would have to pass it for several nids or just only work when only 1 nid is specified.

Drupal.org could then use the test json file produces by this change with core's test to make sure they would work.

drumm’s picture

Project: Drupal.org infrastructure » Drupal.org customizations
Version: » 7.x-3.x-dev
Component: Updates System » Security advisories

For any core implementation of this -

  • The versions affected can and do change as the security team works through a fix. Is/will the core implementation be able to handle this changing?
  • The security team may have to say some versions might be affected. Is/will the core implementation ready to handle a message that might not be “actionable?”

When there is a highly critical vulnerability, the timeline is often compressed. The security team will need to announce incomplete information in the PSA in some cases. It would be ideal if we could tell everyone only exactly what they need, but in reality, the messaging can’t always be straightforward.