首页 -> 安全研究

安全研究

安全漏洞
ViewCVS跨站脚本执行漏洞

发布日期:2002-05-24
更新日期:2002-05-28

受影响系统:
ViewCVS ViewCVS 0.9.2
ViewCVS ViewCVS 0.9.1
ViewCVS ViewCVS 0.9
ViewCVS ViewCVS 0.8
描述:
BUGTRAQ  ID: 4818
CVE(CAN) ID: CVE-2002-0771

ViewCVS是一款查看CVS系统的脚本,可使用在Unix和Linux操作系统下,也可使用在Microsoft Windows操作系统下。

ViewCVS对用户提供的数据未进行正确充分的检查,可导致远程攻击者进行跨站脚本执行攻击。

其中viewcvs.cgi对用户提供给URL的数据缺少过滤,攻击者可以在运行ViewCVS系统的站点上构建包含恶意代码的URL链接,当论坛用户浏览此包含恶意代码的链接时,就可以导致脚本代码在浏览用户浏览器中执行,使攻击者获得用户基于Cookie认证的敏感信息。

<*来源:office (office@office.ac
  
  链接:http://archives.neohapsis.com/archives/bugtraq/2002-05/0161.html
*>

建议:
临时解决方法:

如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:

* 设置浏览器,关闭JavaScript功能。

* 修改服务器程序,严格过滤用户输入数据。

厂商补丁:

ViewCVS
-------
Kenji Suzuki <kenji@po.ganseki.ne.jp>提供如下补丁:

--- viewcvs.py.orig Fri Dec 14 23:14:39 2001
+++ viewcvs.py Sun Mar 31 15:24:34 2002
@@ -172,7 +172,7 @@
# parse the query params into a dictionary (and use defaults)
query_dict = default_settings.copy()
for name, values in cgi.parse().items():
- query_dict[name] = values[0]
+ query_dict[name] = cgi.escape(values[0])

# set up query strings, prefixed by question marks and ampersands
query = sticky_query(query_dict)

Taku YASUI <tach@sourceforge.jp>提供如下补丁:

RCS file: /cvsroot/viewcvs/viewcvs/lib/viewcvs.py,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- viewcvs/viewcvs/lib/viewcvs.py 2002/02/22 09:20:46 1.107
+++ viewcvs/viewcvs/lib/viewcvs.py 2002/04/01 01:32:16 1.108
@@ -180,8 +180,14 @@

# parse the query params into a dictionary (and use defaults)
query_dict = default_settings.copy()
+
+ # RE that ViewCVS doesn't use in any URL, but a CSS attack might
+ re_url_validate = re.compile('\'|"|<|>')
for name, values in cgi.parse().items():
- query_dict[name] = values[0]
+ # do not accept values that contain non-ViewCVS characters
+ # except for search
+ if not re.search(re_url_validate, values[0]) or name == 'search':
+ query_dict[name] = values[0]

# set up query strings, prefixed by question marks and ampersands
query = sticky_query(query_dict)

浏览次数:2844
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障