forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfea164a
committed
Shore up ADMIN OPTION restrictions.
Granting a role without ADMIN OPTION is supposed to prevent the granteefrom adding or removing members from the granted role. Issuing SET ROLEbefore the GRANT bypassed that, because the role itself had an implicitright to add or remove members. Plug that hole by recognizing thatimplicit right only when the session user matches the current role.Additionally, do not recognize it during a security-restricted operationor during execution of a SECURITY DEFINER function. The restriction onSECURITY DEFINER is not security-critical. However, it seems best for auser testing his own SECURITY DEFINER function to see the same behaviorothers will see. Back-patch to 8.4 (all supported versions).The SQL standards do not conflate roles and users as PostgreSQL does;only SQL roles have members, and only SQL users initiate sessions. Anapplication using PostgreSQL users and roles as SQL users and roles willnever attempt to grant membership in the role that is the session user,so the implicit right to add or remove members will never arise.The security impact was mostly that a role member could revoke accessfrom others, contrary to the wishes of his own grantor. Unapproved rolemember additions are less notable, because the member can still largelyachieve that by creating a view or a SECURITY DEFINER function.Reviewed by Andres Freund and Tom Lane. Reported, independently, byJonas Sundman and Noah Misch.Security:CVE-2014-00601 parent0983315 commitfea164a
File tree
5 files changed
+120
-18
lines changed- doc/src/sgml/ref
- src
- backend
- commands
- utils/adt
- test/regress
- expected
- sql
5 files changed
+120
-18
lines changedLines changed: 7 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
395 | 395 |
| |
396 | 396 |
| |
397 | 397 |
| |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 |
| - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
403 | 405 |
| |
404 | 406 |
| |
405 | 407 |
| |
|
Lines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1366 | 1366 |
| |
1367 | 1367 |
| |
1368 | 1368 |
| |
1369 |
| - | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1370 | 1379 |
| |
1371 | 1380 |
| |
1372 | 1381 |
| |
|
Lines changed: 40 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4582 | 4582 |
| |
4583 | 4583 |
| |
4584 | 4584 |
| |
| 4585 | + | |
| 4586 | + | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
4585 | 4590 |
| |
4586 | 4591 |
| |
4587 | 4592 |
| |
| |||
4899 | 4904 |
| |
4900 | 4905 |
| |
4901 | 4906 |
| |
4902 |
| - | |
4903 |
| - | |
4904 |
| - | |
4905 |
| - | |
4906 |
| - | |
| 4907 | + | |
| 4908 | + | |
| 4909 | + | |
4907 | 4910 |
| |
4908 | 4911 |
| |
4909 | 4912 |
| |
| |||
4912 | 4915 |
| |
4913 | 4916 |
| |
4914 | 4917 |
| |
4915 |
| - | |
4916 |
| - | |
4917 |
| - | |
4918 |
| - | |
4919 |
| - | |
4920 | 4918 |
| |
4921 | 4919 |
| |
4922 | 4920 |
| |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
| 4927 | + | |
| 4928 | + | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
| 4933 | + | |
| 4934 | + | |
| 4935 | + | |
| 4936 | + | |
| 4937 | + | |
| 4938 | + | |
| 4939 | + | |
| 4940 | + | |
| 4941 | + | |
| 4942 | + | |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
4923 | 4953 |
| |
4924 | 4954 |
| |
4925 | 4955 |
| |
|
Lines changed: 35 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
| |||
948 | 948 |
| |
949 | 949 |
| |
950 | 950 |
| |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
951 | 985 |
| |
952 | 986 |
| |
953 | 987 |
| |
|
Lines changed: 28 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| |||
599 | 599 |
| |
600 | 600 |
| |
601 | 601 |
| |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
602 | 629 |
| |
603 | 630 |
| |
604 | 631 |
| |
|
0 commit comments
Comments
(0)