CVE-2023-27524:Apache Superset未授权访问漏洞

渗透技巧 11个月前 admin
393 0 0

关注我们❤️,添加星标?,一起学安全!
作者:Locks_@Timeline Sec
本文字数:2730
阅读时长:3~5min
声明:仅供学习参考使用,请勿用作违法用途,否则后果自负

0x01 简介

Apache Superset是一个开源的数据可视化和数据探测平台,它基于Python构建,使用了一些类似于Django和Flask的Python web框架。提供了一个用户友好的界面,可以轻松地创建和共享仪表板、查询和可视化数据,也可以集成到其他应用程序中。

0x02 漏洞概述

漏洞编号:CVE-2023-27524
Apache Superset中的一个身份验证绕过漏洞(CVE-2023-27524)。由于Apache Superset存在不安全的默认配置,未根据安装说明更改默认SECRET_KEY的系统受此漏洞影响,未经身份认证的远程攻击者利用此漏洞可以访问未经授权的资源或执行恶意代码。

0x03 影响版本

Apache Superset <= 2.0.1

0x04 环境搭建

环境搭建这里可以使用docker搭建,链接 

https://superset.apache.org/docs/installation/installing-superset-using-docker-compose/#3-launch-superset-through-docker-compose

curl -L https://github.com/docker/compose/releases/download/1.29.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

git clone https://github.com/apache/superset.git

cd superset

git checkout 2.0.0

TAG=2.0.0 docker-compose -f docker-compose-non-dev.yml pull

TAG=2.0.0 docker-compose -f docker-compose-non-dev.yml up


CVE-2023-27524:Apache Superset未授权访问漏洞

0x05 漏洞复现

Apache Superset是基于python中的flask web框架编写的,flask是一个python轻量级web框架,它的session存储在客户端的cookie字段中。为了防止session篡改,flask进行了如下的处理(代码存放在flask模块中sessions.py文件中):

"""The default session interface that stores sessions in signed cookies
through the :mod:`itsdangerous` module.
"
""

#: the salt that should be applied on top of the secret key for the
#: signing of cookie based sessions.
salt = "cookie-session"
#: the hash function to use for the signature. The default is sha1
digest_method = staticmethod(hashlib.sha1)
#: the name of the itsdangerous supported key derivation. The default
#: is hmac.
key_derivation = "hmac"
#: A python serializer for the payload. The default is a compact
#: JSON derived serializer with support for some extra Python types
#: such as datetime objects or tuples.
serializer = session_json_serializer
session_class = SecureCookieSession

def get_signing_serializer(self, app):
if not app.secret_key:
return None
signer_kwargs = dict(
key_derivation=self.key_derivation, digest_method=self.digest_method
)
return URLSafeTimedSerializer(
app.secret_key,
salt=self.salt,
serializer=self.serializer,
signer_kwargs=signer_kwargs,
)
……
……

使用漏洞利用工具 下载地址:

https://github.com/horizon3ai/CVE-2023-27524

下载完毕后,解压进入 执行本地命令
pip3 install -r .requirements.txt

执行命令后,会爆出一个cookie
python.exe .CVE-2023-27524.py -u http://xx.xx.xx.xx:8088/ --validate

攻击者可以利用爆破出来的key伪造一个user_id值设置为1的会话cookie,以管理员身份登录。在浏览器的本地存储中设置伪造的会话 cookie 并刷新页面允许攻击者以管理员身份访问应用程序。SQL Lab接口允许攻击者对连接的数据库运行任意SQL语句。根据数据库用户权限,攻击者可以查询、修改和删除数据库中的任何数据,以及在数据库服务器上执行远程代码。

eyJfdXNlcl9pZCI6MSwidXNlcl9pZCI6MX0.ZHmZZg._EDUdrG5oZ3sGiPriNIV94fjzQw

CVE-2023-27524:Apache Superset未授权访问漏洞

使用burp拦截请求包

这里是GET,也就是说不需要登录,直接刷新获取即可

CVE-2023-27524:Apache Superset未授权访问漏洞

然后替换cookie后,进行发送

CVE-2023-27524:Apache Superset未授权访问漏洞

成功进入后台页面

CVE-2023-27524:Apache Superset未授权访问漏洞

成功登录进去Apache Superset 管理后台 ,里面可以执行一些sql语句等操作(证明有危害即可,不要随意执行sql语句篡改数据)

0x06 修复方式

目前厂商已发布升级补丁以修复漏洞,补丁获取链接:https://lists.apache.org/thread/n0ftx60sllf527j7g11kmt24wvof8xyk

参考链接

https://blog.csdn.net/weixin_46944519/article/details/130483576


推荐服务

CVE-2023-27524:Apache Superset未授权访问漏洞

历史漏洞

暂无


后台功能

回复【1】领取新人学习资料
回复【
2】进入漏洞查询功能
回复【
3】获取微信加群方式
回复【
4】领取安全电子书籍

回复5】进入SRC-QQ交流群


商务合作

Timeline Sec团队可合作项目清单

原文始发于微信公众号(Timeline Sec):CVE-2023-27524:Apache Superset未授权访问漏洞

版权声明:admin 发表于 2023年6月21日 上午9:02。
转载请注明:CVE-2023-27524:Apache Superset未授权访问漏洞 | CTF导航

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...