931
the applications the user is running, an attacker could potentially discover what a user's actions are.
From this, higher levels of security could be breached.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 377 Insecure Temporary File 925
Relevant to the view "Software Development" (CWE-699)
Nature Type ID Name Page
MemberOf 1219 File Handling Issues 2480
Applicable Platforms
Language : Not Language-Specific (Prevalence = Undetermined)
Likelihood Of Exploit
Low
Common Consequences
Scope Impact Likelihood
Confidentiality Read Application Data
Since the file is visible and the application which is using
the temp file could be known, the attacker has gained
information about what the user is doing at that time.
Detection Methods
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST),
can find some instances of this weakness by analyzing source code (or binary/compiled code)
without having to execute it. Typically, this is done by building a model of data flow and control
flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input)
with "sinks" (destinations where the data interacts with external components, a lower layer such
as the OS, etc.)
Effectiveness = High
Potential Mitigations
Phase: Requirements
Many contemporary languages have functions which properly handle this condition. Older C
temp file functions are especially susceptible.
Phase: Implementation
Try to store sensitive tempfiles in a directory which is not world readable -- i.e., per-user
directories.
Phase: Implementation
Avoid using vulnerable temp file functions.
Demonstrative Examples
Example 1:
CWE Version 4.14
CWE-379: Creation of Temporary File in Directory with Insecure Permissions
CWE-379: Creation of Temporary File in Directory with Insecure Permissions