Anyone with the permission "administer software updates" can perform upgrade.
This is creating a lot of issues in the WebTest.

This ticket is to discuss if the upgraded should be restricted to user1

Comments

abhishek-anand created an issue. See original summary.

alexpott’s picture

Well it is not just web test - if the migration is preserving IDs and a user is logged in as a user that will be migrated all sorts of weird things can happen.

xjm’s picture

Category: Feature request » Task

I think it would make sense to restrict this permission to user 1. As @mikeryan pointed out, it doesn't make sense to have data like a user account in the destination site before migration anyway.

@alexpott and I discussed whether it should also have a settings.php override flag, but agreed that would not work from a security standpoint.

xjm’s picture

Project: Migrate Upgrade » Drupal core
Version: 8.x-1.x-dev » 8.1.x-dev
Component: Code » migration system
catch’s picture

Why wouldn't the settings.php override work from a security standpoint? Doesn't really seem worse than the update.php one, or leaving the installer open on an uninstalled site etc.

I have a knee-jerk reaction against requiring user 1 only, since we've got various issues open to try to discourage people from logging in as user/1. Although I get why we can't let other users migrate when the migration is supposed to destroy their account potentially.

alexpott’s picture

@catch because update_free_access does not require you to be anonymous. So you could be another user and then this is overwritten by the incoming migration and you are suddenly logged in as a user you should not be able to log in as.

catch’s picture

We could make the access check (user 1 || (anonymous && $migrate_free_access) though to avoid that.

alexpott’s picture

Category: Task » Bug report
Status: Active » Needs review
StatusFileSize
new4.21 KB

This is fixing a bug - if you are logged in as user which does not have administer software updates in the source site the migration will break.

Status: Needs review » Needs work

The last submitted patch, 8: 2675066-7.patch, failed testing.

The last submitted patch, 8: 2675066-7.patch, failed testing.

The last submitted patch, 8: 2675066-7.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new4.21 KB

Gonna re-upload the patch and see if that helps...

Status: Needs review » Needs work

The last submitted patch, 12: 2675066-12.patch, failed testing.

The last submitted patch, 12: 2675066-12.patch, failed testing.

The last submitted patch, 12: 2675066-12.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new475 bytes
new4.24 KB

Missing an @group from the test - fun...

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.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

Version: 8.2.x-dev » 8.1.x-dev

Since the Migrate UI is alpha-experimental and new as of 8.1.x, this and other issues for it can be committed during the 8.1.x beta.

I don't think having a $migrate_free_access is a good idea, for the reasons @alexpott describes, but also the risk of someone leaving a site open to migrate anything attackers want into it seems pretty... well, not worth risking. For update.php, you already need access to the codebase to change things. And for migrate it's not just an uninstalled site; it'd be easy to leave it on accidentally post-migration.

benjy’s picture

If the access check is only checking if we're user 1 is it worth having a generic, SuperUser access check rather than migrate specific? Although I would agree, we don't want to encourage people using it as it wouldn't normally be needed.

alexpott’s picture

@benjy I think we don't want to encourage people to use it. Doing something like this on a case by case is acceptable.

benjy’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good to me.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: 2675066-16.patch, failed testing.

alexpott’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated test failure :(

  • catch committed 2e50c28 on 8.2.x
    Issue #2675066 by alexpott, xjm: Restrict migrate upgrade permission to...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Yes agreed on keeping the user 1 access to a one-off, don't want to make that easy and this is a very particular case.

Committed/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.