Missing Check for Certificate Revocation after Initial Check

Draft Variant
Structure: Simple
Description

The product does not check the revocation status of a certificate after its initial revocation check, which can cause the product to perform privileged actions even after the certificate is revoked at a later time.

Extended Description

If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.

Common Consequences 3
Scope: Access Control

Impact: Gain Privileges or Assume Identity

Trust may be assigned to an entity who is not who it claims to be.

Scope: Integrity

Impact: Modify Application Data

Data from an untrusted (and possibly malicious) source may be integrated.

Scope: Confidentiality

Impact: Read Application Data

Data may be disclosed to an entity impersonating a trusted entity, resulting in information disclosure.

Potential Mitigations 1
Phase: Architecture and Design
Ensure that certificates are checked for revoked status before each use of a protected resource. If the certificate is checked before each access of a protected resource, the delay subject to a possible race condition becomes almost negligible and significantly reduces the risk associated with this issue.
Demonstrative Examples 1
The following code checks a certificate before performing an action.

Code Example:

Bad
C
c

//do stuff* foo=SSL_get_verify_result(ssl);

c
While the code performs the certificate verification before each action, it does not check the result of the verification after the initial attempt. The certificate may have been revoked in the time between the privileged actions.
References 2
The CLASP Application Security Process
Secure Software, Inc.
2005
ID: REF-18
24 Deadly Sins of Software Security
Michael Howard, David LeBlanc, and John Viega
McGraw-Hill
2010
ID: REF-44
Likelihood of Exploit

Medium

Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Modes of Introduction
Implementation
Taxonomy Mapping
  • CLASP
  • Software Fault Patterns