Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Discovered way to grant/revoke any right from any user!

Re: Discovered way to grant/revoke any right from any user!

From: Jurij Modic <jmodic_at_src.si>
Date: Fri, 16 Apr 1999 22:12:07 GMT
Message-ID: <3717aee1.2953261@news.siol.net>


On Fri, 16 Apr 1999 19:27:29 +0200, "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:

>.....[SNIPed comments about potential security loophole,
> demonstrated by another tkyte's brilliant example].....
>I have seen a privilege called 'become user'. Yet I didn't see any command
>to accomplish that (except during imp of course). This seems to me a more
>legitimate way to address this. On some operating systems (Vax/VMS, Unix)
>this is working well. Does a similar command exist or is it in the 'next
>version'?

It is undocumented ALTER SESSION variant:

ALTER SESSION SET CURRENT_SCHEMA = <user_name>

With it (provided you have been granted BECOME USER sys privilege) you can change your current schema to somone elses schema. However this doesn't mean that you also get the schema owner's privileges - you still act under your own privileges. So with it you still can't connect to someone elses schema and grant any privileges on its objects, unles you have been given those privileges with ADMIN OPTION.

This command merely eliminates the need to specify the owner name when referencing objects outside your own schema. Consider the following:

SQL> connect system/manager
Connected.
SQL> select count(*) from emp;
select count(*) from emp

                     *

ERROR at line 1:
ORA-00942: table or view does not exist

SQL> select count(*) from scott.emp;

  COUNT(*)


        14

SQL> alter session set current_schema=scott;

Session altered.

SQL> select count(*) from emp;

  COUNT(*)


        14

SQL> grant select on emp to public;
grant select on emp to public

                *

ERROR at line 1:
ORA-01031: insufficient privileges

>The second question is quite obvious, and it is probably a feature request:
>couldn't we make sure Oracle closes this loophole in the near future.
>
>Best regards,
>
>Sybrand Bakker, Oracle DBA

Regards,

Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Fri Apr 16 1999 - 17:12:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US