【问题标题】:Bypass table privilege and WITH GRANT OPTION by creating views通过创建视图绕过表特权和 WITH GRANT OPTION
【发布时间】:2016-04-26 09:15:48
【问题描述】:

在 Oracle 中,用户只需要查看视图的权限就可以从中选择,更准确地说,是视图从表中看到的内容。表上的特权不是必需的。

让我们考虑一下这种情况:

Table T belongs to A
A GRANT SELECT ON T to B (without GRANT OPTION)
B CREATE VIEW V AS SELECT * FROM A.T
B GRANT SELECT ON V TO C
C performing SELECT * FROM B.V

按照上面的规则,C可以从V中选择,因此相当于从T中选择。这是作弊吗? B 有效地让 C 看到 A.T,尽管 C 没有 T 的权利并且 B 没有 GRANT OPTION。某处是否存在安全漏洞?

【问题讨论】:

  • A 不希望除 B 以外的任何人查询 T,因此他不给 B WITH GRANT OPTION。但是通过创建视图 B 将所有信息提供给 C 和其他所有人,有效地欺骗了 A。此外,如果 C 在 V 上创建另一个视图并做同样的事情,最终每个人都会看到 A 试图隐藏的内容。

标签: oracle view oracle11g privileges grant


【解决方案1】:

你所描述的不起作用。作为用户 A:

create table t (id number);

Table T created.

grant select on t to b;

Grant succeeded.

作为用户 B:

create view v as select * from a.t;

View V created.

grant select on v to c;

SQL Error: ORA-01720: grant option does not exist for 'A.T'
01720. 00000 -  "grant option does not exist for '%s.%s'"
*Cause:    A grant was being performed on a view or a view was being replaced
           and the grant option was not present for an underlying object.
*Action:   Obtain the grant option on all underlying objects of the view or
           revoke existing grants on the view.

这是提到in the documetation

注意:
要将视图上的 SELECT 授予另一个用户,您必须拥有该视图下的所有对象,或者您必须已被授予对所有这些底层对象的 SELECT 对象特权 WITH GRANT OPTION。即使被授权者已经对这些底层对象拥有 SELECT 权限也是如此。

即使grant any object privilege 权限也不能绕过这个;虽然必须有一些(强大的)特权,作为一个完整的 DBA 可以grant select on b.v to c

【讨论】:

  • 谢谢亚历克斯。这是一个非常特殊的规则。
猜你喜欢
  • 1970-01-01
  • 2014-12-08
  • 1970-01-01
  • 2021-10-17
  • 1970-01-01
  • 2013-02-19
  • 1970-01-01
  • 2023-03-29
  • 2015-11-09
相关资源
最近更新 更多