Skip to content
Spring Cloud Platform Issues 63

Spring Cloud Platform Issues 63

github.com • November 29, 2026

本项目是一个开源项目,任何用户都能获取到该项目中的硬编码的JWT Secret。同时,使用JWT Secret默认值启动项目时并没有任何警告提示,所以大多数用户可能不会修改此JWT Secret默认值,这可能导致攻击者伪造任意用户的权限令牌,从而绕过认证与授权机制,访问受保护接口。

Spring-Cloud-Platform/ace-modules/ace-admin/src/main/resources/application.yml

该密钥种子一旦泄露,攻击者可以在本地生成与服务端完全一致的 RSA 私钥和公钥,从而伪造可通过验签的 JWT。

Token 中的这些字段均属于攻击者可得或可伪造信息,不依赖服务端生成且不可伪造的高熵字段。

该校验模式属于半状态 Token:网关虽然回查 Redis,但只检查 tokenId 是否存在,没有验证该 tokenId 是否属于当前 JWT 的主体信息,因此攻击者只要复用一个仍然有效的 tokenId ,就可以把它塞进伪造 Token 中通过校验。

攻击者从仓库读取硬编码密钥种子 xx1WET12^%3^(WE45 。

攻击者在本地使用相同种子生成与服务端一致的 RSA 密钥对。

攻击者构造 JWT,并任意指定 username 、 userId 、 name 等身份字段。

攻击者复用一个仍然有效的 tokenId ,例如自己已登录 Token 中的 tokenId 。

伪造 Token 通过 RS256 验签后,服务端会把其中的身份信息写入 BaseContextHandler 。

后续权限校验会基于该身份从数据库读取角色和权限,攻击者即可冒充目标用户访问受保护接口。

可以将JWT Secret放入系统环境变量中或者禁止使用默认值启动项目。

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

Hardcoded JWT Secrets in Two Open-Source Projects Enable Token Forgery Two GitHub issues, both published 2026-11-29, report that open-source projects (marmotedu/iam and wxiaoqi/Spring-Cloud-Platform) ship hardcoded JWT signing secrets in their repositories. The IAM project reportedly contains the fixed value 'asfdlajsdfaf234' in a committed build artifact (dist/config.js) and a default 'secret-key' in an example config, and the report states that starting the project with these defaults produces no warning. The Spring Cloud Platform report describes a hardcoded RSA key seed ('xx1WET12^%3^(WE45') from which an attacker could reproduce the RSA key pair and forge tokens that pass RS256 verification. Per the reports, an attacker holding the secret could construct JWTs with arbitrary user IDs or identity fields, which the services would accept, enabling impersonation including of administrators. The Spring Cloud report additionally states that the gateway checks only whether a tokenId exists in Redis, not whether it belongs to the token's subject, so a valid tokenId from the attacker's own session can be reused in a forged token. The IAM report notes that the database lookup on decoded.id does not prevent impersonation because the ID comes from the attacker-controlled payload. Both reports recommend moving the secret to environment variables or refusing to start with default values. The articles are issue-tracker entries rather than CVE-assigned advisories, and no exploitation in the wild or affected user counts are reported. 68