Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/jeecg-boot/jmreport/upload接口存在未授权任意文件上传 #4990

Closed
Garck3h opened this issue May 28, 2023 · 4 comments
Closed

/jeecg-boot/jmreport/upload接口存在未授权任意文件上传 #4990

Garck3h opened this issue May 28, 2023 · 4 comments

Comments

@Garck3h
Copy link

Garck3h commented May 28, 2023

版本号:

目前确定影响:3.5.0 & 3.5.1(其它版本未验证)

前端版本:vue3版?还是 vue2版?

vue3版

问题描述:

经测试发现/jeecg-boot/jmreport/upload接口存在未授权任意文件上传,可以上传html文件造成存储型的XSS。

截图&代码:

下载使用https://github.com/jeecgboot/jeecg-boot项目源代码启动项目后,
入口:“报表设计器”-->"新建报表"-->"插入图片"
抓取包,获得上传接口,下面证明任意文件上传的存在。
image
image
image
修改后缀为html,添加js代码
image
访问后,成功执行
image
尝试上传sh,上传成功
image
###源码分析
在org.jeecg.modules.jmreport.desreport.a包里面的a.java是一个controller;当做post请求/jeecg-boot/jmreport/upload的时候就会来到这个方法里面。

image

进行判断了之后,然后进入LOCAL方法,我们跟进去一直来到了a方法。这里只是做了“../”的过滤。

image

然后调用getUpload()获取存储的路径,做了一系列的赋值之后,来到var8得到了最终的路径,然后通过new File传进var8的值,创建了新的文件,至此实现了任意文件类型的上传。

image

友情提示(为了提高issue处理效率):

  • 未按格式要求发帖,会被直接删掉;
  • 描述过于简单或模糊,导致无法处理的,会被直接删掉;
  • 请自己初判问题描述是否清楚,是否方便我们调查处理;
  • 针对问题请说明是Online在线功能(需说明用的主题模板),还是生成的代码功能;
@zhangdaiscott
Copy link
Member

ws

@1298191366
Copy link

已修复,待新版本发布

@hadasbloom
Copy link

Hi! Could you link the commit that fixes this issue please?

Thanks 🙏

@zhangdaiscott
Copy link
Member

升级积木报表到最新版本即可,1.6.1+

org.jeecgframework.jimureport
jimureport-spring-boot-starter
1.6.1

http://jimureport.com/doc/log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants