587
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 1177 Use of Prohibited Code 1972
Relevant to the view "Software Development" (CWE-699)
Nature Type ID Name Page
MemberOf 1228 API / Function Errors 2482
Weakness Ordinalities
Primary :
Applicable Platforms
Language : C (Prevalence = Undetermined)
Language : C++ (Prevalence = Undetermined)
Likelihood Of Exploit
High
Common Consequences
Scope Impact Likelihood
Other Varies by Context
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: Implementation
Phase: Requirements
Ban the use of dangerous functions. Use their safe equivalent.
Phase: Testing
Use grep or static analysis tools to spot usage of dangerous functions.
Demonstrative Examples
Example 1:
The code below calls gets() to read information into a buffer.
Example Language: C (Bad)
char buf[BUFSIZE];
gets(buf);
CWE Version 4.14
CWE-242: Use of Inherently Dangerous Function
CWE-242: Use of Inherently Dangerous Function