-
Notifications
You must be signed in to change notification settings - Fork 453
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
captcha_api_check 不安全 #176
Comments
暂时写了一个解决方案。全安性有所提高。
|
This was referenced Nov 25, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
////验证操作
if (!captcha_api_check($request->captcha, $request->key)){
return $this->response->array(['status_code' => 400, 'message' => '验证码不匹配' ]);
}
https://blog.csdn.net/Eric_Alive/article/details/83274143
这种api的方式,只是能生成的验证码,进行了hash。 但是这有个问题时,在调用captcha_api_check函数后或验证后并没有让其它过期功能。这样我就可以用这个code 和key常期请求api。他也在验证通过的。因为只是对比了code的hash值.
想到的一个解决办法是,在发验证码时,把成生的hash缓存起来, 判断时:在判断captcha_api_check的同时,再验证hash缓存是否还存在(不存在说明已经使用过了,存在说明还没有使用)。 验证通过后,立即删除缓存。
The text was updated successfully, but these errors were encountered: