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

修复前台任意文件上传 #1059

Merged
merged 1 commit into from
Jan 15, 2021
Merged

修复前台任意文件上传 #1059

merged 1 commit into from
Jan 15, 2021

Conversation

plzmyy
Copy link
Contributor

@plzmyy plzmyy commented Aug 12, 2020

\server\Application\Home\Controller\PageController.class.php第150行

$upload->allowExts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型

$upload->allowExts 不是 Think\Upload 类的正确用法,导致文件后缀限制失效

并且方法里面没有进行$this->checkLogin();导致未登录上传文件,即前台gethell

本地起个服务器测试

上传图片,并抓包,将文件名改为plzmyy.<>php

image

image

生产环境下测试

image

image

修改为

$upload->exts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型

image

参考链接:RoarCTF2019 simple_upload

@star7th
Copy link
Owner

star7th commented Aug 12, 2020

感谢提醒这个问题。此方法已经不再使用了的。我已经屏蔽了。现在上传文件都是使用Api里面的控制器。

@star7th star7th merged commit 189b6ce into star7th:master Jan 15, 2021
@GitChenfan
Copy link

请问是哪个版本进行的修正?

@star7th
Copy link
Owner

star7th commented Apr 9, 2021

我现在不记得了。总之升级到最新版代码。

@punitdarji
Copy link

Cloud you possibly make vulnerable docker?

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

Successfully merging this pull request may close these issues.

4 participants