moxi624 / mogu_blog_v2

蘑菇博客(MoguBlog),一个基于微服务架构的前后端分离博客系统。Web端使用Vue + Element , 移动端使用uniapp和ColorUI。后端使用Spring cloud + Spring boot + mybatis-plus进行开发,使用 Jwt + Spring Security做登录验证和权限校验,使用ElasticSearch和Solr作为全文检索服务,使用Github Actions完成博客的持续集成,使用ELK收集博客日志,文件支持上传七牛云和Minio,支持Docker Compose脚本一键部署。

Home Page:http://www.moguit.cn/#/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using hardcoded cryptographic key when creating and verifing Json Web Token.

KANIXB opened this issue · comments

Hi, we are a research group to help developers build secure applications. We designed a cryptographic misuse detector on Java language(Our main concern is the secure implementation and use of Json Web Token). We found your great public repository (i.e.,mogu_blog_v2) from Github, and several security issues detected by our detector are shown in the following. The specific security issues we found are as follows:
(1) Location: Package: package com.moxi.mogublog.utils; Class: JwtUtil.class
Security issue: Using predictable/constant seed to generate cryptographic key when creating and verifing Json Web Token.

Using a hard-coded seed to generate key [(new SecretKeySpec(encodedKey, 0, encodedKey.length, "AES");] does not conform to the security implementation specification of JWT, which may bring security risks to your system. It is recommended that you use a more secure way to generate the key used to generate the JWT. (For the hazards of hardcoded keys, you can refer to CWE-321, NIST Special Publication 800-57).

We wish the above security issues cloud truly help you to build a secure application. If you have any concern or suggestion, please feel free to contact us, we are looking forwart to your reply. Thanks.