Nasty security bug with clustering

Started by Christopher Kings-Lynneover 21 years ago5 messages
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

No check is performed for being a superuser, the table owner or that it
is a system table when marking an index for clustering:

usa=> alter table pg_class cluster on "pg_class_oid_index";
ALTER TABLE
usa=> select oid from pg_class where relname='pg_class_oid_index';
oid
-------
16613
(1 row)

usa=> select * from pg_index where indexrelid=16613;
indexrelid | indrelid | indkey | indclass | indnatts | indisunique |
indisprimary | indisclustered | indexprs | indpred
------------+----------+--------+----------+----------+-------------+--------------+----------------+----------+---------
16613 | 1259 | -2 | 1989 | 1 | t | f
| t | |
(1 row)

Note how I managed to mark as clustered an index on a system catalog as
a non-superuser...

Chris

#2Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Christopher Kings-Lynne (#1)
Re: Nasty security bug with clustering

No check is performed for being a superuser, the table owner or that it
is a system table when marking an index for clustering:

I'm about to submit my SET WITHOUT CLUSTER patch, so I'll fix this bug
in that.

Chris

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#2)
Re: Nasty security bug with clustering

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:

No check is performed for being a superuser, the table owner or that it
is a system table when marking an index for clustering:

I'm about to submit my SET WITHOUT CLUSTER patch, so I'll fix this bug
in that.

I'm in the middle of reviewing (read whacking around) Rod Taylor's patch
for multiple operations in ALTER TABLE, so I'm afraid that no patch in
the same area is likely to apply cleanly after the dust settles :-(

I had noted the lack of permissions checks in CLUSTER ON (it's fairly
glaring in the reorganized code) and planned to fix it along with what
I was doing.

regards, tom lane

#4Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Tom Lane (#3)
Re: Nasty security bug with clustering

I'm in the middle of reviewing (read whacking around) Rod Taylor's patch
for multiple operations in ALTER TABLE, so I'm afraid that no patch in
the same area is likely to apply cleanly after the dust settles :-(

OK, Bruce - just ignore the patch I sent in. I'll refactor it after Tom
commits.

Chris

#5Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Tom Lane (#3)
Re: Nasty security bug with clustering

I'm in the middle of reviewing (read whacking around) Rod Taylor's patch
for multiple operations in ALTER TABLE, so I'm afraid that no patch in
the same area is likely to apply cleanly after the dust settles :-(

OK, Bruce - just ignore the patch I sent in. I'll refactor it after Tom
commits.

Chris

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly