极狐GitLab 重要安全版本:17.3.3, 17.2.7, 17.1.8, 17.0.8, 16.11.10

GitLab 是一个全球知名的一体化 DevOps 平台,很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab 是 GitLab 在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。

学习极狐GitLab 的相关资料:

  1. 极狐GitLab 官网
  2. 极狐GitLab 官网文档
  3. 极狐GitLab 论坛
  4. 极狐GitLab 安装配置

本分分享更多关于极狐GitLab 重要安全版本 17.3.3, 17.2.7, 17.1.8, 17.0.8, 16.11.10 的详情内容。

今天我们正式发布了极狐GitLab 17.3.3, 17.2.7, 17.1.8, 17.0.8, 16.11.10 版本。该版本包含了重要的缺陷和安全修复,我们强烈建议所有的私有化部署用户应立即升级到上述推荐的某一个版本。对于极狐GitLab SaaS(JihuLab.com)来讲,专业的技术团队已经进行了升级。

建议操作

我们强烈建议所有运行以下描述问题所影响的版本应尽快升级到最新版本。

如果没有指明极狐GitLab 特定的部署类型(ominbus、源代码、helm chart 等),那也就意味着所有的类型都受影响。

安全修复

安全修复表

标题 严重性
SAML 认证绕过 严重

SAML 认证绕过(SAML authentication bypass)漏洞是由 Ruby SAML 库引起的,对应的漏洞 ID为 CVE-2024-45409。将依赖 omniauth-saml升级到 2.2.1、ruby-saml升级到 1.17.0就能够

减轻 CVE-2024-45409 漏洞带来的安全危害。

私有化部署版本:已知的缓解措施

以下针对私有化部署的减缓措施能够成功避免实例受到 CVE-2024-45409 漏洞带来的攻击:

  1. 为极狐GitLab 私有化部署实例上的所有用户开启双因素认证(注意:开启身份识别供应商提供的多因素认证并不能减缓该漏洞带来的安全危害)以及
  2. 不允许在极狐GitLab 中使用 SAML 双因素认证绕过选项
私有化部署实例:识别和检测该漏洞的利用尝试

尝试或成功利用 Ruby-SAML (CVE-2024-45409) 的证据将出现在 GitLab 的 application_json 和 auth_json 日志文件中。

未成功的利用尝试------捕获

未成功的利用尝试可能会从 RubySaml库产生一个 ValidationError信息。这可能是由于构造一个有效利用程序的复杂性所导致的各种原因。

下面展示了两个示例,但是错误可能以其他描述的形式出现,要在 application_json 日志文件中搜索常见的字符串 RubySaml::ValidationError。

  1. 由于不正确的回调 URL 而导致票据(ticket)无效;
    a. 日志事件示例:
    b. {"severity":"ERROR","time":"2024-xx-xx","correlation_id":"xx","message":"(saml) Authentication failure! invalid_ticket: OneLogin::RubySaml::ValidationError, The response was received at https://domain.com/users/auth/saml/incorrect_callback instead of https://domain.com/users/auth/saml/callback"}
  2. 由于证书签名问题而导致的票据(ticket)无效;
    a. 日志事件示例
    b. "message":"(saml) Authentication failure! invalid_ticket: OneLogin::RubySaml::ValidationError, Fingerprint mismatch"
成功的利用尝试------捕获

成功地利用尝试将会触发与 SAML 相关的日志事件。然而,要将正常合法的 SAML 认证事件和漏洞利用尝试成功的事件区别开来是非常有难度的。

成功的利用尝试将记录攻击者在尝试利用时设置的任何 extern_id 值。因此,识别一个在你的组织中不常见的唯一 extern_uid 可能是潜在利用的指示信号。

  1. 在 application_json 日志文件中的示例利用认证事件,其中 extern_id 在利用 PoC 代码中被设置:
    a. 日志事件
    b. {"severity":"INFO","time":"2024-xx-xx","correlation_id":"xx","meta.caller_id":"OmniauthCallbacksController#saml","meta.remote_ip":"0.0.0.0","meta.feature_category":"system_access","meta.client_id":"ip/0.0.0.0","message":"(SAML) saving user exploit-test-user@domain.com from login with admin =\\u003e false, extern_uid =\\u003e exploit-test-user"}

在构造利用程序时,攻击者需要制作许多 SAML 断言以完美复制合法登录。这些断言包括你在身份提供者(IdP)处指定的密钥和值字段,且这些字段可能对未经授权的人员未知------尤其是当你自定义了这些属性时。

你可以查看 auth_json 日志文件,以查找属性部分中信息不正确或缺失的 SAML 响应。

  1. 在 auth_json 日志文件中的 SAML authentication 事件示例
    a. "severity":"INFO","time":"2024-xx-xx","correlation_id":"xx","meta.caller_id":"OmniauthCallbacksController#saml","meta.remote_ip":"0.0.0.0","meta.feature_category":"system_access","meta.client_id":"ip/0.0.0.0","payload_type":"saml_response": {"issuer": ["xxx"],"name_id": "xxx","name_id_format": "xxx","name_id_spnamequalifier": null,"name_id_namequalifier": null,"destination": "xxx","audiences": ["xxx"],"attributes": {"first_name": ["xxx"],"last_name": ["yyy"], "email": ["zzz"]}}

对于私有化部署的客户,可以将极狐GitLab 的 application_json 日志转发到 SIEM,可以创建检测规则以识别 Ruby-SAML (CVE-2024-45409) 利用尝试。我们的团队提供了两条用 Sigma 格式编写的威胁检测规则,以检测潜在的利用行为。

注意:这些检测规则可能需要根据客户的环境进行调整和修改,以提供有效的结果。由于不同客户环境的配置各异,客户应验证这些检测规则识别的事件的合法性和准确性。

一段时间内具有多个唯一 extern_uid 的用户

此检测旨在识别具有多个 extern_uid 值与认证事件相关联的已认证 SAML 用户,这可能是攻击者设置了 extern_uid 字段的恶意认证的潜在迹象。

title: Multiple extern_ids
description: Detects when their are multiple extern_id's associated with a user. 
author: Gitlab Security Engineering
date: 09/15/2024
schedule: "*/10 * * * *"
pseudocode: |
  select log source application.log
  where 7d < event_time < now()
  where severity="INFO" and meta_caller_id="Groups::OmniauthCallbacksController#group_saml"
  regex(message, "saving user (?<user_email>\S+) .*extern_uid \S+ (?<extern_id>[\S]+)")
  count extern_id by user_email as total_extern_ids
  where total_extern_ids > 1
verify: Review Gitlab application logs for the source IP of the SAML authentications. If there is a singular IP for all extern_ids this could point to a false positive. Cross reference the SAML authentication source IP/s with the known user's IP from sso authentication logs. 
tuning: N/A
在一段时间内,同一用户的 GitLab SAML 认证与其他身份提供者(IdP)事件的 IP 地址不同

此检测旨在关联用户的认证事件,比较 GitLab SAML 认证事件与其他身份提供者(IdP)的认证事件,以识别用户 IP 地址的任何变化,这可能是攻击者认证会话的迹象。

title: Gitlab SAML IP differs from SSO IP
description: Detects when the source IP for the SAML authentication to Gitlab from application.log differs from the users known IP from SSO MFA logs. 
author: Gitlab Security Engineering
date: 09/15/2024
schedule: "*/10 * * * *"
pseudocode: |
  select log source application.log 
  where severity="INFO" and meta_caller_id="Groups::OmniauthCallbacksController#group_saml"
  regex(message, "saving user (?<user_email>\S+) ")
  #Create sub-query to bring in table from SSO authentication data
  select meta_remote_ip, user_email
  where user_email in
    (
    select log source authentication
    where 1d < event_time < now()
    where event_type="user.authentication.auth_via_mfa"
    group by user_email, sso_source_ip
    )
  where sso_source_ip!=meta_remote_ip
verify: False positives can arise when the user is traveling. Review SSO authentication logs to see if the geo-location is similar to the SAML authentication to Gitlab. If any discrepancies are found, reach out to the user for verification. If the user is not traveling, temporarily lock the user's Gitlab account and review their activity through Gitlab's application logs. 
tuning: If the query is producing high false positives, consider using

修复的缺陷

17.3.3
  • 升级了 OpenSSL 3 的升级告警说明
  • 升级了极狐GitLab 备份命令的 gem bundler
  • 升级了 ruby-saml 和 omniauth-saml
17.2.7
  • 升级了 OpenSSL 3 的升级告警说明
  • 升级了 ruby-saml 和 omniauth-saml
17.1.8
  • 升级了 OpenSSL 3 的升级告警说明
  • 升级了 ruby-saml 和 omniauth-saml
17.0.8
  • 升级了 ruby-saml 和 omniauth-saml
16.11.10
  • 升级了 ruby-saml 和 omniauth-saml

关于极狐GitLab 的安装升级以及 GitLab 升级到极狐GitLab 的详情可以查看官网指南

相关推荐
深圳特力康何哈哈1 小时前
镭射限高防外破预警装置-线路防外破可视化监控,安全尽在掌握中
安全
anddddoooo1 小时前
vulnhub(13):Digitalworld.local JOY(ftp 的未授权文件读写漏洞、文件覆盖提权)
linux·网络·安全·web安全·网络安全
RFID铨顺宏2 小时前
铨顺宏科技携RTLS+RFID技术亮相工博会!
安全·职场和发展
速盾cdn3 小时前
速盾:cdn一般多长时间清理下缓存?
服务器·网络·安全·web安全
钢铁小狗侠3 小时前
网络编程(5)——模拟伪闭包实现连接的安全回收
网络·安全
心之所想,行之将至3 小时前
gitlab集成CI/CD,shell方式部署
运维·ci/cd·gitlab
GEEKVIP4 小时前
手机使用技巧:如何修复变砖的 Android 手机
android·windows·安全·macos·智能手机·电脑·笔记本电脑
KookeeyLena84 小时前
住宅ip有什么特殊点
网络·tcp/ip·安全
MXsoft6184 小时前
一体化运维监控管理平台的全面监控能力
安全·系统安全
九河云7 小时前
AWS开启MFA,提高安全性
服务器·安全·云计算·aws