Skip to content

Merge target is resolved outside the options the screen offered #5141

Description

@elias-ba

As a maintainer, I want the merge target to come from the list the user was actually offered, so that a merge cannot be aimed somewhere the UI deliberately excluded.

Part of #4852 (Sandbox DevX epic).

What's wrong

The sandbox management screen builds its merge target options by filtering the workspace: it leaves out the sandbox itself, its descendants, and any project scheduled for deletion. Then, when the merge is confirmed, it resolves the chosen target by searching every project in the workspace rather than that filtered list.

So the filtering only holds as long as the client sends back one of the values it was given. A crafted confirm event can name a project the list deliberately left out, including the sandbox itself and a project already scheduled for deletion.

How bad

Not an escalation. The merge is still authorised against the target, so this needs editor or above on whatever project is named, and it cannot reach a project the user has no rights on. It predates the current sandbox work.

It matters more than it did, though, because a merge now also writes to the source project. #5139 records a version row on each source workflow a merge carried, so a merge aimed somewhere unintended writes there too.

What to fix

Resolve the target from the same filtered options the screen offered, and refuse anything else.

Acceptance criteria

  • Given a confirm event naming a project outside the offered options, then the merge is refused.
  • Given a confirm event naming the sandbox itself or one of its descendants, then the merge is refused.
  • Given a confirm event naming a project scheduled for deletion, then the merge is refused.
  • Given an ordinary merge chosen from the dropdown, then nothing changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions