[Forgot Password]
Login  Register Subscribe

30481

 
 

423868

 
 

256040

 
 

909

 
 

199103

 
 

282

Paid content will be excluded from the download.


Download | Alert*
CWE
view XML

Race Condition Enabling Link Following

ID: 363Date: (C)2012-05-14   (M)2022-10-10
Type: weaknessStatus: DRAFT
Abstraction Type: Base





Description

The software checks the status of a file or directory before accessing it, which produces a race condition in which the file can be replaced with a link before the access is performed, causing the software to access the wrong file.

Extended Description

While developers might expect that there is a very narrow time window between the time of check and time of use, there is still a race condition. An attacker could cause the software to slow down (e.g. with memory consumption), causing the time window to become larger. Alternately, in some situations, the attacker could win the race by performing a large number of attacks.

Applicable Platforms
Language Class: All

Time Of Introduction

  • Architecture and Design
  • Implementation

Related Attack Patterns

Common Consequences

ScopeTechnical ImpactNotes
Confidentiality
Integrity
 
Read files or directories
Modify files or directories
 
 

Detection Methods
None

Potential Mitigations
None

Relationships
This is already covered by the "Link Following" weakness (CWE-59). It is included here because so many people associate race conditions with link problems; however, not all link following issues involve race conditions.

Related CWETypeViewChain
CWE-363 ChildOf CWE-894 Category CWE-888  

Demonstrative Examples   (Details)

  1. This code prints the contents of a file if a user has permission. (Demonstrative Example Id DX-49)

White Box Definitions
None

Black Box Definitions
None

Taxynomy Mappings

TaxynomyIdNameFit
PLOVER  Race condition enabling link following
 
 
CERT C Secure Coding POS35-C
 
Avoid race conditions while checking for the existence of a symbolic link
 
 

References:

  1. Mark Dowd John McDonald Justin Schuh .The Art of Software Security Assessment 1st Edition. Addison Wesley. Section:'Chapter 9, "Race Conditions", Page 526.'. Published on 2006.
CVE    1
CVE-2022-21658

© SecPod Technologies