CWE-385: Covert Timing Channel | Glexia
CWE-385 (Covert Timing Channel) weakness overview with consequences, detection methods, mitigations, related CVEs and MITRE ATT&CK context.
Glexia's Take · Automated analysis
CWE-385: Covert Timing Channel
Covert Timing Channel represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Confidentiality,Other: Read Application Data,Other: Information exposure.
Developer Pattern
CWE-385 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Automation confidence
high confidence from CWE-385, 4.20.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Official CWE Definition
CWE-385: Covert Timing Channel
Covert timing channels convey information by modulating some aspect of system behavior over time, so that the program receiving the information can observe system behavior and infer protected information.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- In this example, the attacker observes how long an authentication takes when the user types in the correct password. 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.,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.
Remediation
- 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.
Detection
- Code review
- SAST
- DAST
- Focused regression tests
Mappings
Related CVEs, CWEs, and ATT&CK context
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.
