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

版本通杀无条件登陆任意用户 #23

Closed
qhxb opened this issue Jul 10, 2019 · 4 comments
Closed

版本通杀无条件登陆任意用户 #23

qhxb opened this issue Jul 10, 2019 · 4 comments

Comments

@qhxb
Copy link

qhxb commented Jul 10, 2019

APPLICATION、$params['user_id']可以被用户控制,存在变量覆盖问题。
image
利用修改头像接口
1、添加参数application=app跟参数user_id,导致$params['user_id']用户id变成用户指定id
image
2、进入UserLoginRecord方法,这里好像没啥问题
image
3、进入UserAvatarUpload方法,这里完成图片上传后又调用了UserLoginRecord方法
image
4、再进入UserLoginRecord方法。因为这次调用没有指定$is_app,默认为false
image
这就导致了最终结果变成当前session存储的用户变成用户指定的任意用户id,并且这个id是一个可以猜测的简单数字
5、最终效果
image

@gongfuxiang
Copy link
Owner

APPLICATION,$ params ['user_id']可以被用户控制,存在变量覆盖问题。 利用修改头像接口 1,添加参数application = app跟参数user_id,导致$ params ['user_id']用户id变成用户指定id 2 ,进入UserLoginRecord方法,这里好像没啥问题 3,进入UserAvatarUpload方法,这里完成图片上传后又调用了UserLoginRecord方法 4,再进入UserLoginRecord方法。因为这次调用没有指定$ IS_APP,默认为假 这就导致了最终结果变成当前会话存储的用户变成用户指定的任意用户ID,并且这个ID是一个可以猜测的简单数字 5,最终效果
图片

图片

图片

图片

图片

图片

非常感谢你的反馈,1.6已经修复了该问题,请在1.6上验证一下

@qhxb
Copy link
Author

qhxb commented Jul 10, 2019

image
1.6部署成功,但是点首页报错

@gongfuxiang
Copy link
Owner

image
1.6部署成功,但是点首页报错

application/tags.php
用1.5这个文件替换一下、开发版本里面有不存在的狗子
https://gitee.com/gongfuxiang/shopxo/blob/master/application/tags.php

@qhxb
Copy link
Author

qhxb commented Jul 10, 2019

v1.6.0修复了,没这个问题了

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

2 participants