Führe statische Analyse (SAST) auf der Codebasis aus und suche im Datenfluss nach dem unsicheren Muster.
Predictable from Observable State
This vulnerability occurs when an attacker can guess or deduce sensitive values, like random numbers or identifiers, by observing predictable system or network characteristics such as timestamps,…
What is CWE-341?
Real-world CVEs caused by CWE-341
-
Mail server stores private mail messages with predictable filenames in a world-executable directory, which allows local users to read private mailing list archives.
-
PRNG allows attackers to use the output of small PRNG requests to determine the internal state information, which could be used by attackers to predict future pseudo-random numbers.
-
DNS resolver library uses predictable IDs, which allows a local attacker to spoof DNS query results.
-
MFV. predictable filename and insecure permissions allows file modification to execute SQL queries.
Angreiferpfad Schritt für Schritt
- 1
This code generates a unique random identifier for a user's session.
- 2
Because the seed for the PRNG is always the user's ID, the session ID will always be the same. An attacker could thus predict any user's session ID and potentially hijack the session.
- 3
This example also exhibits a Small Seed Space (CWE-339).
Vulnerable PHP
This code generates a unique random identifier for a user's session.
function generateSessionID($userID){
srand($userID);
return rand();
} Secure pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
const safe = validateAndEscape(input);
return executeWithGuards(safe);
} How to prevent CWE-341
- Implementation Increase the entropy used to seed a PRNG.
- Architecture and Design / Requirements Use products or modules that conform to FIPS 140-2 [REF-267] to avoid obvious entropy problems. Consult FIPS 140-2 Annex C ("Approved Random Number Generators").
- Implementation Use a PRNG that periodically re-seeds itself using input from high-quality sources, such as hardware devices with high entropy. However, do not re-seed too frequently, or else the entropy source might block.
How to detect CWE-341
Führe dynamische Application-Security-Tests gegen den Live-Endpoint aus.
Beobachte Runtime-Logs auf ungewöhnliche Exception-Traces, fehlerhafte Eingaben oder Versuche, Autorisierung zu umgehen.
Code Review: Markiere jeden neuen Code, der Eingaben von dieser Oberfläche ohne validierte Framework-Helper verarbeitet.
Plexicus erkennt CWE-341 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.
Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.
Frequently asked questions
Was ist CWE-341?
This vulnerability occurs when an attacker can guess or deduce sensitive values, like random numbers or identifiers, by observing predictable system or network characteristics such as timestamps, process IDs, or other public information.
Wie gravierend ist CWE-341?
MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.
Welche Sprachen oder Plattformen sind von CWE-341 betroffen?
MITRE hat für diese CWE keine betroffenen Plattformen spezifiziert — sie kann in den meisten Anwendungs-Stacks auftreten.
Wie kann ich CWE-341 verhindern?
Increase the entropy used to seed a PRNG. Use products or modules that conform to FIPS 140-2 [REF-267] to avoid obvious entropy problems. Consult FIPS 140-2 Annex C ("Approved Random Number Generators").
Wie erkennt und behebt Plexicus CWE-341?
Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-341 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.
Wo erfahre ich mehr über CWE-341?
MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/341.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.
Weaknesses related to CWE-341
Generation of Predictable Numbers or Identifiers
This vulnerability occurs when a system creates numbers or identifiers that are too easy to guess, undermining security mechanisms that…
Predictable Exact Value from Previous Values
This vulnerability occurs when a system uses a predictable sequence for generating values, allowing an attacker to accurately guess future…
Predictable Value Range from Previous Values
This vulnerability occurs when a system's random number generator produces values that, after observing previous outputs, allow an…
Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.
Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.