diff options
| author | Robert Haas | 2022-03-28 17:38:13 +0000 |
|---|---|---|
| committer | Robert Haas | 2022-03-28 17:38:13 +0000 |
| commit | 79de9842ab03259325ee4055fb0a7ebd2e4372ff (patch) | |
| tree | 114ec9a3a09c07d8051c9269b83fd75be31b818c /doc/src | |
| parent | 61762426e6edbe87100dd5a4f107e8c06a11ec02 (diff) | |
Remove the ability of a role to administer itself.
Commit f9fd1764615ed5d85fab703b0ffb0c323fe7dfd5 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, commit fea164a72a7bfd50d77ba5fb418d357f8f2bb7d0 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
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/ref/grant.sgml | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/grant.sgml b/doc/src/sgml/ref/grant.sgml index a897712de2e..8c4edd9b0a7 100644 --- a/doc/src/sgml/ref/grant.sgml +++ b/doc/src/sgml/ref/grant.sgml @@ -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> |
