原理由于JWT令牌的安全校验使用的是硬编码,导致攻击者可伪造合法的JWT令牌进行访问。危害由于默认情况下,初始管理员的 userId 是相同的,未授权攻击者可以利用 JWT 密钥配合该 userId 伪造令牌,从而访问受保护的API路由。分析Tenable的一名研究人员在D-Link D-View 8 v2.0.1.28中发现了一个身份验证绕过漏洞。D-View 8使用硬编码的密钥(D-Link)来保护用户身份验证中使用的JWT令牌:// webApi-0.0.1-SNAPSHOT.jar!com.dlink.dview8.webapi.utils.TokenUtils public static String verifyToken(String token) { if (Utils.isEmpty(token)) return null; Algorithm algorithm = Algorithm.HMAC256("D-Link"); JWTVerifier verifier = JWT.require(algor
Equinox
一个乐于分享的网安人