目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1000

100.0%

CWE-336 PRNG中使用相同种子 类漏洞列表 2

CWE-336 PRNG中使用相同种子 类弱点 2 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-336 属于伪随机数生成器种子固定漏洞。由于伪随机数生成器具有确定性,每次初始化使用相同种子会导致输出序列完全一致。若攻击者知晓或推测出该种子,即可预测后续生成的所有随机数,从而破坏会话令牌或加密密钥的安全性。开发者应避免使用固定种子,转而采用操作系统提供的加密级随机源(如 /dev/urandom),确保每次生成过程具备不可预测性。

MITRE CWE 官方描述
CWE:CWE-336 伪随机数生成器 (PRNG) 使用相同的种子 伪随机数生成器 (PRNG) 在产品每次初始化时都使用相同的种子。 鉴于伪随机数生成器 (PRNG) 的确定性特性,每次初始化使用相同的种子将导致以相同的顺序产生相同的输出。如果攻击者可以猜测(或已知)该种子,则攻击者可能能够确定伪随机数生成器 (PRNG) 将产生的随机数。
常见影响 (1)
Other, Access ControlOther, Bypass Protection Mechanism
缓解措施 (2)
Architecture and DesignDo not reuse PRNG seeds. Consider a PRNG that periodically re-seeds itself as needed from a high quality pseudo-random output, such as hardware devices.
Architecture and Design, RequirementsUse products or modules that conform to FIPS 140-2 [REF-267] to avoid obvious entropy problems, or use the more recent FIPS 140-3 [REF-1192] if possible.
代码示例 (2)
The following code uses a statistical PRNG to generate account IDs.
private static final long SEED = 1234567890; public int generateAccountID() { Random random = new Random(SEED); return random.nextInt(); }
Bad · Java
This code attempts to generate a unique random identifier for a user's session.
function generateSessionID($userID){ srand($userID); return rand(); }
Bad · PHP
CVE ID标题CVSS风险等级Published
CVE-2026-24044 Element Server Suite 安全漏洞 — ess-helm 9.1AICriticalAI2026-02-12
CVE-2021-42810 Thales Sentinel Protection Installer 安全漏洞 — SafeNet Authentication Service 7.8 High2022-01-19

CWE-336(PRNG中使用相同种子) 是常见的弱点类别,本平台收录该类弱点关联的 2 条 CVE 漏洞。