CWE-339: Small Seed Space in PRNG

Variant Draft Simple

CWE版本: 4.18

更新日期: 2025-09-09

弱点描述

A Pseudo-Random Number Generator (PRNG) uses a relatively small seed space, which makes it more susceptible to brute force attacks.

扩展描述

PRNGs are entirely deterministic once seeded, so it should be extremely difficult to guess the seed. If an attacker can collect the outputs of a PRNG and then brute force the seed by trying every possibility to see which seed matches the observed output, then the attacker will know the output of any subsequent calls to the PRNG. A small seed space implies that the attacker will have far fewer possible values to try to exhaust all possibilities.

常见后果

影响范围: Other

技术影响: Varies by Context

潜在缓解措施

阶段: Architecture and Design

描述: Use well vetted pseudo-random number generating algorithms with adequate length seeds. Pseudo-random number generators can produce predictable numbers if the generator is known and the seed can be guessed. A 256-bit seed is a good starting point for producing a "random enough" number.

阶段: Architecture and Design Requirements

策略: Libraries or Frameworks

描述: Use 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.

观察示例

参考: CVE-2019-10908

product generates passwords via org.apache.commons.lang.RandomStringUtils, which uses java.util.Random internally. This PRNG has only a 48-bit seed.

引入模式

阶段 说明
Implementation REALIZATION: This weakness is caused during implementation of an architectural security tactic.

适用平台

编程语言
Not Language-Specific (Undetermined)

分类映射

分类名称 条目ID 条目名称 映射适配度
PLOVER - Small Seed Space in PRNG -
关键信息

CWE ID: CWE-339

抽象级别: Variant

结构: Simple

状态: Draft

相关弱点