@app.route('/profile/<username>') @login_required def profile(username): user = User.query.filter_by(username=username).first() # 应该这么校验 if current_user == user: ... else: flash("You have no permission to access this page.") return redirect(url_for('index'))
权限管理没做好,导致低权限用户可以访问高权限用户的页面。同上,做好权限校验
用户身份识别和安全防护
这章主要讲的是验证码和二次验证码的安全,基本上可以概括为:
无论哪种验证码,都应该要有一个过期时间。
为了保证安全,都不该可以被猜测
总结
下一步打算认认真真研究一下kali这个系统了。
Maybe you could buy me a cup of coffee.
Scan this qrcode
Open alipay app scan this qrcode, buy me a coffee!
Scan this qrcode
Open wechat app scan this qrcode, buy me a coffee!