You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Console: the page of a user, group or role named new, or of a user named . or .., cannot be opened #845
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.
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