CWE-385 Base Incomplete Medium likelihood

Covert Timing Channel

A covert timing channel is a security flaw where an attacker can deduce secret information by observing how long certain operations take to execute. Instead of directly reading data, they analyze…

Definition

What is CWE-385?

A covert timing channel is a security flaw where an attacker can deduce secret information by observing how long certain operations take to execute. Instead of directly reading data, they analyze timing variations in system behavior to infer protected details.
Attackers can exploit timing differences to learn secrets they shouldn't have access to. For instance, if a cryptographic function or a database query takes slightly longer under specific conditions, that delay can leak information about the internal state of the operation or the data being processed. Monitoring these subtle time variations allows an attacker to piece together sensitive information. This type of vulnerability is a classic example of a side-channel attack, specifically a timing channel. Common real-world signals include variations in a system's paging rate, the execution time of a transaction, or the delay in accessing a shared resource. Defending against these attacks requires ensuring that operations complete in constant time, regardless of the input or secret data involved.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-385

Bisher sind in MITREs Katalog keine öffentlichen CVE-Referenzen mit dieser CWE verknüpft.

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    In this example, the attacker observes how long an authentication takes when the user types in the correct password.

  2. 2

    When the attacker tries their own values, they can first try strings of various length. When they find a string of the right length, the computation will take a bit longer, because the for loop will run at least once. Additionally, with this code, the attacker can possibly learn one character of the password at a time, because when they guess the first character right, the computation will take longer than a wrong guesses. Such an attack can break even the most sophisticated password with a few hundred guesses.

  3. 3

    Note that in this example, the actual password must be handled in constant time as far as the attacker is concerned, even if the actual password is of an unusual length. This is one reason why it is good to use an algorithm that, among other things, stores a seeded cryptographic one-way hash of the password, then compare the hashes, which will always be of the same length.

Verwundbares Codebeispiel

Vulnerable Python

When the attacker tries their own values, they can first try strings of various length. When they find a string of the right length, the computation will take a bit longer, because the for loop will run at least once. Additionally, with this code, the attacker can possibly learn one character of the password at a time, because when they guess the first character right, the computation will take longer than a wrong guesses. Such an attack can break even the most sophisticated password with a few hundred guesses.

Verwundbar Python
def validate_password(actual_pw, typed_pw): 
  		if len(actual_pw) <> len(typed_pw): 
  			return 0
  		for i in len(actual_pw): 
  			if actual_pw[i] <> typed_pw[i]: 
  				return 0
  		return 1
Sicheres Codebeispiel

Secure pseudo

Sicher pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
  const safe = validateAndEscape(input);
  return executeWithGuards(safe);
}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Präventions-Checkliste

How to prevent CWE-385

  • Architecture and Design Whenever possible, specify implementation strategies that do not introduce time variances in operations.
  • Implementation Often one can artificially manipulate the time which operations take or -- when operations occur -- can remove information from the attacker.
  • Implementation It is reasonable to add artificial or random delays so that the amount of CPU time consumed is independent of the action being taken by the application.
Erkennungssignale

How to detect CWE-385

SAST High

Führe statische Analyse (SAST) auf der Codebasis aus und suche im Datenfluss nach dem unsicheren Muster.

DAST Moderate

Führe dynamische Application-Security-Tests gegen den Live-Endpoint aus.

Runtime Moderate

Beobachte Runtime-Logs auf ungewöhnliche Exception-Traces, fehlerhafte Eingaben oder Versuche, Autorisierung zu umgehen.

Code review Moderate

Code Review: Markiere jeden neuen Code, der Eingaben von dieser Oberfläche ohne validierte Framework-Helper verarbeitet.

Plexicus Auto-Fix

Plexicus erkennt CWE-385 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.

Häufig gestellte Fragen

Frequently asked questions

Was ist CWE-385?

A covert timing channel is a security flaw where an attacker can deduce secret information by observing how long certain operations take to execute. Instead of directly reading data, they analyze timing variations in system behavior to infer protected details.

Wie gravierend ist CWE-385?

MITRE stuft die Exploit-Wahrscheinlichkeit als mittel ein — eine Ausnutzung ist realistisch, erfordert aber meist bestimmte Bedingungen.

Welche Sprachen oder Plattformen sind von CWE-385 betroffen?

MITRE hat für diese CWE keine betroffenen Plattformen spezifiziert — sie kann in den meisten Anwendungs-Stacks auftreten.

Wie kann ich CWE-385 verhindern?

Whenever possible, specify implementation strategies that do not introduce time variances in operations. Often one can artificially manipulate the time which operations take or -- when operations occur -- can remove information from the attacker.

Wie erkennt und behebt Plexicus CWE-385?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-385 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-385?

MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/385.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.

Bereit, wenn du es bist

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.