安全研究

安全漏洞
GitLab本地文件包含漏洞(CVE-2013-4582)

发布日期:2014-05-12
更新日期:2014-05-13

受影响系统:
GitLab GitLab 6.x
描述:
CVE(CAN) ID: CVE-2013-4582

GitLab,是一个利用Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。

GitLab 5.4.2, Community Edition 6.2.4, Enterprise Edition 6.2.1, gitlab-shell 1.7.8之前版本存在安全漏洞,远程攻击者可通过GitLab Web接口,利用此漏洞包含服务器上Git库元数据内的本地文件。

<*来源:joernchen
  *>

建议:
临时解决方法:

如果您不能立刻安装补丁或者升级,NSFOCUS建议您在/home/git/gitlab-shell内运用下面补丁以降低威胁:


--- a/lib/gitlab_projects.rb
+++ b/lib/gitlab_projects.rb
@@ -48,7 +48,7 @@ class GitlabProjects
   def create_branch
     branch_name = ARGV.shift
     ref = ARGV.shift || "HEAD"
-    cmd = %W(git --git-dir=#{full_path} branch #{branch_name} #{ref})
+    cmd = %W(git --git-dir=#{full_path} branch -- #{branch_name} #{ref})
     system(*cmd)
   end

@@ -61,7 +61,7 @@ class GitlabProjects
   def create_tag
     tag_name = ARGV.shift
     ref = ARGV.shift || "HEAD"
-    cmd = %W(git --git-dir=#{full_path} tag #{tag_name} #{ref})
+    cmd = %W(git --git-dir=#{full_path} tag -- #{tag_name} #{ref})
     system(*cmd)
   end

@@ -94,7 +94,7 @@ class GitlabProjects
   def import_project
     @source = ARGV.shift
     $logger.info "Importing project #{@project_name} from <#{@source}> to <#{full_path}>."
-    cmd = %W(git clone --bare #{@source} #{full_path})
+    cmd = %W(git clone --bare -- #{@source} #{full_path})
     system(*cmd) && create_hooks(full_path)
   end

@@ -156,7 +156,7 @@ class GitlabProjects
     end

     $logger.info "Forking project from <#{full_path}> to <#{full_destination_path}>."
-    cmd = %W(git clone --bare #{full_path} #{full_destination_path})
+    cmd = %W(git clone --bare -- #{full_path} #{full_destination_path})
     system(*cmd) && create_hooks(full_destination_path)
   end

厂商补丁:

GitLab
------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

https://www.gitlab.com/
https://gitlab.com/gitlab-org/gitlab-ce
https://github.com/gitlabhq/gitlabhq

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