背景知识FlaskFlask作为Python语言中最为轻量的Web框架, 由于其核心内容的简洁以及良好的可拓展性, 一直受到广泛的开发者所喜爱。由于是轻量级的Web框架,使得Flask的Session机制是使用JWT保存在客户端的,当我们得知flask的SECRET_KEY即可进行Session的伪造。JSON Web Token(JWT)JSON Web Token (JWT)是一个开放标准(RFC 7519),它定义了一种紧凑的、自包含的方式,用于作为JSON对象在各方之间安全地传输信息。该信息可以被验证和信任,因为它是数字签名的。JSON Web Token由三部分组成,它们之间用圆点(.)连接。这三部分分别是:Header,存放签名算法Payload,存放数据Signature,存放签名值因此,一个典型的JWT看起来是这个样子的:xxxxx.yyyyy.zzzzz因为使用了base64编码,这个字符串通常以eyJ开头。Flask的JWT实现与标准JWT略有不同。Flask Session 的组成结构主要由三部分构成:第一部分为Session Data ,即会话数据。第二部分为T
Equinox
一个乐于分享的网安人