mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Remove the ability of a role to administer itself.
Commitf9fd176461
effectively gave every role ADMIN OPTION on itself. However, this appears to be something that happened accidentally as a result of refactoring work rather than an intentional decision. Almost a decade later, it was discovered that this was a security vulnerability. As a result, commitfea164a72a
restricted this implicit ADMIN OPTION privilege to be exercisable only when the role being administered is the same as the session user and when no security-restricted operation is in progress. That commit also documented the existence of this implicit privilege for what seems to be the first time. The effect of the privilege is to allow a login role to grant the privileges of that role, and optionally ADMIN OPTION on it, to some other role. That's an unusual thing to do, because generally membership is granted in roles used as groups, rather than roles used as users. Therefore, it does not seem likely that removing the privilege will break things for many PostgreSQL users. However, it will make it easier to reason about the permissions system. This is the only case where a user who has not been given any special permission (superuser, or ADMIN OPTION on some role) can modify role membership, so removing it makes things more consistent. For example, if a superuser sets up role A and B and grants A to B but no other privileges to anyone, she can now be sure that no one else will be able to revoke that grant. Without this change, that would have been true only if A was a non-login role. Patch by me. Reviewed by Tom Lane and Stephen Frost. Discussion: http://postgr.es/m/CA+Tgmoawdt03kbA+dNyBcNWJpRxu0f4X=69Y3+DkXXZqmwMDLg@mail.gmail.com
This commit is contained in:
@@ -251,11 +251,10 @@ GRANT <replaceable class="parameter">role_name</replaceable> [, ...] TO <replace
|
||||
in turn grant membership in the role to others, and revoke membership
|
||||
in the role as well. Without the admin option, ordinary users cannot
|
||||
do that. A role is not considered to hold <literal>WITH ADMIN
|
||||
OPTION</literal> on itself, but it may grant or revoke membership in
|
||||
itself from a database session where the session user matches the
|
||||
role. Database superusers can grant or revoke membership in any role
|
||||
to anyone. Roles having <literal>CREATEROLE</literal> privilege can grant
|
||||
or revoke membership in any role that is not a superuser.
|
||||
OPTION</literal> on itself. Database superusers can grant or revoke
|
||||
membership in any role to anyone. Roles having
|
||||
<literal>CREATEROLE</literal> privilege can grant or revoke membership
|
||||
in any role that is not a superuser.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
Reference in New Issue
Block a user