关于小程序login的code问题

小程序 文章 2022-04-11 15:20 1545 0 全屏看文

AI助手支持GPT4.0

关于小程序login的code问题About the code problem of applet login

关于小程序login的code问题
框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.login() 微信安卓客户端 未知 1.0.0

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html

根据文档可知 小程序端需调用 wx.login 后获取code 然后code可换取用户openid code仅可使用一次

但近期发现攻击者通过触发我方后端检测code的接口,并传入code后生成用户信息

疑问:

1.他的code是在哪获取到的 为什么他会有大量的code(我发现他请求使用的code每天可创建五百条左右用户)?

2.除了根据我方通过ip或其他技术手段避免注册外,微信是否有其他注册方式?


Framework type problem type API / component name terminal type wechat version basic library version applet bug Wx Login() wechat Android client unknown 1.0.0 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html According to the document, the applet needs to call Wx After login, get the code, and then the code can be exchanged for the user. Openid code can only be used once. But recently, it was found that the attacker generated user information by triggering our backend to detect the interface of code and passing in the code. Question: 1 Where did he get his code? Why did he have a large number of codes (I found that the code he requested can create about 500 users every day)? 2. Does wechat have other registration methods besides avoiding registration through IP or other technical means?

回答:

微喵网络:

能通过接口获取openid的code都是合法的code,没办法检测出是否是攻击

Ming:那就是微信官方有bug吗   目前确实发现单ip高频访问我方服务端登录接口   并提供了有效的code
拾忆:

正常code是通过用户访问小程序端才生成的,而且code仅5分钟内有效,被伪造的概率很低。

也不排除人家是通过群控设备去访问的,如果是的话这种无法区分的,如果你知道对方的IP就直接禁止对应IP访问。

也可以使用云函数直接给服务端返回用户的openid,看看还会不会有类似的问题。

八九:

有内鬼!

-EOF-

AI助手支持GPT4.0