GitLab库访问权提升漏洞(CVE-2013-4583)
发布日期:2014-05-12
更新日期:2014-05-13
受影响系统:GitLab GitLab 6.x
描述:
CVE(CAN) ID:
CVE-2013-4583
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之前版本存在安全漏洞,远程攻击者可利用此漏洞提升其库访问权限。
<*来源:joernchen
*>
建议:
临时解决方法:
如果您不能立刻安装补丁或者升级,NSFOCUS建议您在/home/git/gitlab-shell内运用下面补丁以降低威胁:
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -43,7 +43,7 @@ class GitlabShell
def parse_cmd
args = Shellwords.shellwords(@origin_cmd)
@git_cmd = args[0]
- @repo_name = args[1]
+ @repo_name = escape_path(args[1])
end
def git_cmds
@@ -86,4 +86,12 @@ class GitlabShell
def log_username
@config.audit_usernames ? username : "user with key #{@key_id}"
end
+
+ def escape_path(path)
+ if File.absolute_path(path, repos_path) == File.join(repos_path, path)
+ path
+ else
+ raise "Wrong repository path"
+ end
+ end
end
厂商补丁:
GitLab
------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
https://www.gitlab.com/
https://gitlab.com/gitlab-org/gitlab-ce
https://github.com/gitlabhq/gitlabhq浏览次数:2041
严重程度:0(网友投票)