Skip to content

Console: the page of a user, group or role named new, or of a user named . or .., cannot be opened #845

Open

Description

@LeeroyHannigan

Problem

The console serves the forms that create a user, a group and a role at /console/accounts/{id}/users/new, /groups/new and /roles/new. The detail pages use /console/accounts/{id}/users/{name}, /groups/{name} and /roles/{name} (crates/server/src/console/mod.rs:92 to :127). The router, matchit 0.8.4, gives a static segment priority over a parameter. So the page of a user, group or role named new cannot be opened.

The management API accepts these names. is_valid_iam_name allows new, . and .. (crates/server/src/management/mod.rs:226).

Measured

On a SQLite server with the console code of #844, which has the same routes as main:

  • The management API creates a user, a group and a role named new, each with HTTP 201.
  • As admin, /console/accounts/{id}/users/new, /groups/new and /roles/new open the create forms. The pages of the three named new cannot be reached.
  • The management API creates users named . and .., each with HTTP 201. A client that removes dot segments, as browsers do, sends /console/accounts/{id}/users/ and /console/accounts/{id}/ for their links, and both answer 404. A client that keeps the raw path opens "User: ." and "User: ..".
  • extenddb manage sends the raw paths. list-access-keys returns [] for both users, and delete-user deletes only those two users.
  • With fix(console): serve an IAM user its own user page and access keys only #844, the dashboard card of an IAM user named new links to /users/new, which redirects the user to /console. So that user cannot reach its access key forms.

Expected

The console can open the page of every name that the management API accepts. Two ways:

  • Refuse new, . and .. as user, group and role names in the management API and the console forms. A user that already has such a name needs a documented step.
  • Move the create forms to paths that cannot collide with a name, such as /console/accounts/{id}/new-user. This does not help . and .., because browsers remove dot segments before they send the request.

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions