weefunker/CVE-2026-27944-Lab

GitHub: weefunker/CVE-2026-27944-Lab

CVE-2026-27944 漏洞复现实验环境,演示 Nginx-UI 未认证备份下载与加密密钥泄露的完整攻击流程。

Stars: 0 | Forks: 0

# CVE-2026-27944 - Nginx-UI 未认证备份下载 [![CVE](https://img.shields.io/badge/CVE-2026--27944-red.svg)](https://nvd.nist.gov/vuln/detail/CVE-2026-27944) [![CVSS](https://img.shields.io/badge/CVSS-9.8%20(Critical)-critical.svg)](https://www.first.org/cvss/calculator/3.1) [![GHSA](https://img.shields.io/badge/GHSA-g9w5--qffc--6762-orange.svg)](https://github.com/advisories/GHSA-g9w5-qffc-6762) ## 📖 概述 本仓库包含一个功能完整的实验环境,用于演示 **CVE-2026-27944**,这是一个影响 Nginx-UI 版本 < 2.3.2 的严重漏洞。 该漏洞允许**未认证攻击者**: 1. 通过 `/api/backup` endpoint 下载完整系统备份 2. 从 `X-Backup-Security` 响应头获取加密密钥 3. 解密并提取敏感数据,包括凭证、API 密钥和 SSL 证书 ![漏洞利用演示](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/3c835493d7200303.png) ## 🎯 漏洞详情 | 属性 | 值 | |-----------|-------| | **CVE ID** | CVE-2026-27944 | | **CVSS 评分** | 9.8 (严重) | | **CVSS 向量** | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | | **受影响软件包** | nginx-ui (Go) | | **受影响版本** | < 2.3.2 | | **已修复版本** | ≥ 2.3.3 | | **CWE** | CWE-306 + CWE-311 | ### 根本原因 ``` ┌─────────────────────────────────────────────────────────────────┐ │ 1. Missing Authentication on /api/backup │ │ → No middleware protecting the backup endpoint │ │ │ │ 2. Encryption Key Disclosure │ │ → AES-256 key and IV sent in X-Backup-Security header │ │ → Allows immediate decryption of downloaded backup │ └─────────────────────────────────────────────────────────────────┘ ``` ## 🚀 快速开始 ### 前置条件 - Python 3.8+ - Docker & Docker Compose (可选) - pycryptodome (`pip install pycryptodome`) ### 运行实验环境 ``` # 克隆 repository git clone cd CVENginix/lab # 选项 1:Local execution pip install -r requirements.txt python3 app/server.py # 选项 2:Docker docker-compose up -d ``` ### 运行漏洞利用 ``` # 在一个新 terminal 中 python3 exploits/poc.py --target http://localhost:9000 --decrypt ``` ![服务器运行中](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/244f66db7d200304.png) ## 📁 仓库结构 ``` CVENginix/ ├── lab/ # Vulnerable lab environment │ ├── app/ │ │ └── server.py # Vulnerable server implementation │ ├── exploits/ │ │ └── poc.py # Proof-of-concept exploit │ ├── screenshots/ # Demo screenshots │ ├── docker-compose.yml # Docker orchestration │ ├── Dockerfile # Container image │ ├── requirements.txt # Python dependencies │ └── README.md # Detailed lab documentation ├── screenshots/ # Root screenshots └── README.md # This file ``` ## 🎯 夺旗赛 (CTF) 实验环境包含 3 个隐藏标志,用于验证漏洞利用是否成功: | 标志 | 描述 | |------|-------------| | `CTF{unauthenticated_backup_access_granted}` | 数据库访问 | | `CTF{nginx_config_exposed}` | Nginx 配置 | | `CTF{ssl_private_key_compromised}` | SSL 私钥 | ## 📊 影响评估 ### 攻击者可以访问的内容 ``` backup.zip (decrypted) │ ├── database.db │ ├── User credentials (hashed passwords) │ ├── Session tokens │ └── API keys (live production keys) │ ├── app.ini │ ├── JWT signing secrets │ ├── SMTP credentials │ └── AWS access keys │ ├── nginx.conf │ ├── Server configuration │ └── Internal network topology │ └── ssl/ ├── server.key (RSA private key) └── server.crt ``` ### 攻击链 ``` graph LR A[Unauthenticated Request] --> B[/api/backup] B --> C[Encrypted Backup + Keys in Header] C --> D[Decrypt with Exposed Keys] D --> E[Extract Sensitive Data] E --> F[Full System Compromise] ``` ## 🛡️ 缓解措施 ### 立即行动 1. **升级** 至 nginx-ui ≥ 2.3.3 2. **轮换** 所有已泄露的凭证(如果已被入侵) 3. **撤销** 任何泄露的 API 密钥 4. **重新生成** SSL 证书(如果私钥已泄露) ### 代码修复 ``` // Before (Vulnerable) r.GET("/backup", CreateBackup) // ❌ No auth // After (Fixed) r.GET("/backup", middleware.Auth(), CreateBackup) // ✓ Auth required // Remove key disclosure from response // Store keys server-side or use envelope encryption ``` ## 📚 参考资料 - [NVD - CVE-2026-27944](https://nvd.nist.gov/vuln/detail/CVE-2026-27944) - [GitHub Advisory - GHSA-g9w5-qffc-6762](https://github.com/advisories/GHSA-g9w5-qffc-6762) - [CWE-306: 缺失认证](https://cwe.mitre.org/data/definitions/306.html) - [CWE-311: 缺失加密](https://cwe.mitre.org/data/definitions/311.html) ## ⚠️ 法律免责声明 本仓库仅用于**教育和研究目的**。 - ✅ 用于学习安全漏洞 - ✅ 在受控实验环境中使用 - ✅ 在获得适当授权的情况下使用 - ❌ 请勿对非自有系统使用 - ❌ 请勿在生产环境中使用 ## 📝 许可证 MIT 许可证 - 详情见 [LICENSE](LICENSE)。 ## 🙏 致谢 - 漏洞发现者 **0xJacky** - 原始公告:[GHSA-g9w5-qffc-6762](https://github.com/advisories/GHSA-g9w5-qffc-6762)
标签:API安全, CVE-2026-27944, CWE-306, CWE-311, Go语言, HTTP工具, JSON输出, Nginx, Nginx-UI, PoC, StruQ, Web安全, 备份下载, 密钥泄露, 教育实验, 日志审计, 暴力破解, 未授权访问, 漏洞分析, 漏洞复现, 版权保护, 程序破解, 网络安全, 网络安全审计, 蓝队分析, 请求拦截, 路径探测, 逆向工具, 隐私保护, 靶场环境