JumpServer 未授权 访问命令
执行漏洞
JumpServer 是全球首款完全开源的堡垒机, 使用 GNU GPL v2.0 开源协议, 是符合 4A 的专业运维审计系统。JumpServer 使用 Python / Django 进行开发, 采纳分布式架构, 支持多机房跨区域部署, 中心节点提供 API, 各机房部署登录节点, 可横向扩展、无并发访问限制。
2021 年 1 月 15 日, JumpServer 官方发布更新,修复了一处未授权访问命令执行漏洞。
漏洞描述
由于 JumpServer 部分接口鉴权不严格,远程且未经授权认证的攻击者通过利用这些接口,可以读取 JumpServer 服务端的日志文件,从中获取敏感信息,并可进一步向其管控的主机下发命令,从而可接管其管控的主机资产。
影响范围
JumpServer = v1.5.9
解决方案
升级 JumpServer 至以下安全版本:
JumpServer >= v2.6.2
JumpServer >= v2.5.4
JumpServer >= v2.4.5
如若无法更新版本进行漏洞修复,可参考官方给出的临时修复方案:
修改 Nginx 配置文件屏蔽漏洞接口:
/api/v1/authentication/connection-token/
/api/v1/users/connection-token/
# 社区老版本
/etc/nginx/conf.d/jumpserver.conf
# 企业老版本
jumpserver-release/nginx/http_server.conf
# 新版本在
jumpserver-release/compose/config_static/http_server.conf
修改 Nginx 配置文件实例:
### 保证在 /api 之前 和 / 之前
location /api/v1/authentication/connection-token/ {
return 403;
}
location /api/v1/users/connection-token/ {
return 403;
}
### 新增以上这些
location /api/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://core:8080;
}
...
修改完成后重启 nginx:
docker方式:
docker restart jms_nginx
nginx方式:
systemctl restart nginx修复验证:
$ wget https://github.com/jumpserver/jumpserver/releases/download/v2.6.2/jms_bug_check.sh
# 使用方法 bash jms_bug_check.sh HOST
$ bash jms_bug_check.sh demo.jumpserver.org
漏洞已修复参考资料
https://github.com/jumpserver/jumpserver