akashsingh0454/CVE-2026-0257-PoC
GitHub: akashsingh0454/CVE-2026-0257-PoC
针对 PAN-OS GlobalProtect 身份验证绕过漏洞 CVE-2026-0257 的被动式远程检测脚本,帮助安全人员快速判断资产是否存在风险。
Stars: 2 | Forks: 1
# CVE-2026-0257 — PAN-OS GlobalProtect 身份验证绕过
## 远程检测 PoC




## 概述
CVE-2026-0257 是 Palo Alto Networks PAN-OS 的 GlobalProtect 门户和网关中存在的一个身份验证绕过漏洞(CWE-565 — 依赖 Cookie 而缺乏验证和完整性检查)。当启用了身份验证覆盖 cookie 并且存在特定的证书配置时,未经身份验证的攻击者可以绕过安全限制并建立未授权的 VPN 连接。
- **安全公告:** https://security.paloaltonetworks.com/CVE-2026-0257
- **CVSS 4.0:** 4.7 (MEDIUM) / Base: 7.8
- **CWE:** CWE-565
- **受影响的组件:** GlobalProtect Portal, GlobalProtect Gateway
- **不受影响:** Panorama, Cloud NGFW
## 受影响版本
| 分支 | 存在漏洞 | 已修复 |
|--------|-----------|-------|
| PAN-OS 10.2 | < 10.2.7-h34, < 10.2.10-h36, < 10.2.13-h21, < 10.2.16-h7, < 10.2.18-h6 | 参见安全公告 |
| PAN-OS 11.1 | < 11.1.4-h33, < 11.1.6-h32, < 11.1.7-h6, < 11.1.10-h25, < 11.1.13-h5, < 11.1.15 | 参见安全公告 |
| PAN-OS 11.2 | < 11.2.4-h17, < 11.2.7-h14, < 11.2.10-h7, < 11.2.12 | 参见安全公告 |
| PAN-OS 12.1 | < 12.1.4-h6, < 12.1.7 | 参见安全公告 |
| Cloud NGFW | 不受影响 | — |
| Panorama | 不受影响 | — |
## 暴露所需的配置
该漏洞仅在门户或网关上**启用了身份验证覆盖 cookie** 时适用。要进行检查:
**Portal:** Network → GlobalProtect → Portals → Agent → Agent Config → Authentication 选项卡
- 勾选了 "Generate cookie for authentication override" 或 "Accept cookie for authentication override"
**Gateway:** Network → GlobalProtect → Gateways → Agent → Client Settings → Authentication Override 选项卡
- 勾选了 "Accept cookie for authentication override"
## 本工具
`cve_2026_0257_check.py` 执行被动的、只读的远程检测:
1. **GP 门户/网关检测** — 检查标准的未验证 endpoint 以确认是否存在 GlobalProtect
2. **PAN-OS 版本指纹识别** — 从 Server 标头、登录页面 HTML 和 `/global-protect/portal/config.esp` XML 响应中读取版本
3. **Auth-override cookie 指标** — 查找表明可能已启用基于 cookie 的身份验证覆盖的行为信号
4. **版本范围检查** — 将检测到的版本与安全公告定义的所有易受攻击范围进行比较
### 它不会做的事情
- 不提交凭证
- 不伪造或重放身份验证 cookie
- 不尝试建立 VPN 连接
- 不在目标上写入或修改任何内容
## 环境要求
- Python 3.8+
- 无第三方依赖(仅使用标准库)
## 用法
```
# 单一目标(默认端口 443)
python3 cve_2026_0257_check.py vpn.example.com
# 自定义端口
python3 cve_2026_0257_check.py vpn.example.com:8443
# 多个目标
python3 cve_2026_0257_check.py host1 host2 host3
# JSON 输出
python3 cve_2026_0257_check.py vpn.example.com --json
# 调整 timeout
python3 cve_2026_0257_check.py vpn.example.com --timeout 15
```
## 输出
```
============================================================
Target : vpn.example.com:443
Verdict : LIKELY_VULNERABLE
============================================================
GP Portal reachable : True
GP Gateway reachable : True
PAN-OS version : 11.2.7-h3
Auth-cookie indicator: True
Version vulnerable : True
Notes:
• GlobalProtect portal page found at /global-protect/login.esp (HTTP 200)
• GlobalProtect gateway endpoint present (HTTP 400)
• Version from /global-protect/portal/config.esp: 11.2.7-h3
• portal/config.esp returned HTTP 200 with body — may indicate auth-override cookie acceptance is enabled
[!] Host appears to run a vulnerable PAN-OS version.
Verify auth-override cookie config per the advisory:
https://security.paloaltonetworks.com/CVE-2026-0257
```
### Verdict 值
| Verdict | 含义 |
|---------|---------|
| `LIKELY_VULNERABLE` | 暴露了 GP + 版本处于已知存在漏洞的范围内 |
| `LIKELY_PATCHED` | 暴露了 GP + 版本已确认修复 |
| `POSSIBLE_TARGET_VERSION_UNKNOWN` | 暴露了 GP 但无法读取版本 |
| `NOT_GP_TARGET` | 未检测到 GlobalProtect 门户或网关 |
## 修复方案
根据官方安全公告:
1. **升级** 到已修复的 PAN-OS 版本(参见上方表格)
2. **或者使用专用证书** 专门用于身份验证覆盖 cookie — 不要复用门户/网关证书
3. **或者完全禁用身份验证覆盖**,取消勾选门户和网关配置中的相关选项
修补后,用户将需要重新进行一次身份验证,因为 cookie 将使用更安全的方法重新生成。
## 披露
- **发现者:** 由 Palo Alto Networks PSIRT 内部发现
- **发布日期:** 2026-05-13
- **漏洞利用状态:** 截至发布时未有已知的恶意利用
## 法律声明
本工具旨在用于您拥有或获得明确书面授权进行测试的系统。未经授权对您不拥有的系统使用本工具是违法行为。作者对任何滥用行为不承担责任。
标签:CISA项目, GlobalProtect, Maven, PAN-OS, PoC, 暴力破解, 漏洞验证, 身份验证绕过, 逆向工具