- Home
-
CWE-676: Use of Potentially Dangerous Function
Weakness ID: 676Vulnerability Mapping: ALLOWED This CWE ID may be used to map to real-world vulnerabilities
Abstraction: Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource.View customized information:For users who are interested in more notional aspects of a weakness. Example: educators, technical writers, and project/program managers. For users who are concerned with the practical application and details about the nature of a weakness and how to prevent it from happening. Example: tool developers, security researchers, pen-testers, incident response analysts. For users who are mapping an issue to CWE/CAPEC IDs, i.e., finding the most appropriate CWE for a specific issue (e.g., a CVE record). Example: tool developers, security researchers. For users who wish to see all available information for the CWE/CAPEC entry. For users who want to customize what details are displayed.×
Edit Custom Filter
The product invokes a potentially dangerous function that could introduce a vulnerability if it is used incorrectly, but the function can also be used safely.
This table specifies different individual consequences
associated with the weakness. The Scope identifies the application security area that is
violated, while the Impact describes the negative technical impact that arises if an
adversary succeeds in exploiting this weakness. The Likelihood provides information about
how likely the specific consequence is expected to be seen relative to the other
consequences in the list. For example, there may be high likelihood that a weakness will be
exploited to achieve a certain impact, but a low likelihood that it will be exploited to
achieve a different impact.
Impact Details Varies by Context; Quality Degradation; Unexpected State
Scope: Other If the function is used incorrectly, then it could result in security problems.Phase(s) Mitigation Build and Compilation; Implementation
Identify a list of prohibited API functions and prohibit developers from using these functions, providing safer alternatives. In some cases, automatic code analysis tools or the compiler can be instructed to spot use of prohibited functions, such as the "banned.h" include file from Microsoft's SDL. [REF-554] [REF-1009] [REF-7]
This table shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOf 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 the user
may want to explore.
Relevant to the view "Research Concepts" (View-1000)
Nature Type ID Name ChildOf
Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource.
1177 Use of Prohibited Code ParentOf
Variant - a weakness that is linked to a certain type of product, typically involving a specific language or technology. More specific than a Base weakness. Variant level weaknesses typically describe issues in terms of 3 to 5 of the following dimensions: behavior, property, technology, language, and resource.
785 Use of Path Manipulation Function without Maximum-sized Buffer
Relevant to the view "Software Development" (View-699)
Nature Type ID Name MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.
1228 API / Function Errors
The different Modes of Introduction provide information
about how and when this
weakness may be introduced. The Phase identifies a point in the life cycle at which
introduction
may occur, while the Note provides a typical scenario related to introduction during the
given
phase.
Phase Note Implementation
This listing shows possible areas for which the given
weakness could appear. These
may be for specific named Languages, Operating Systems, Architectures, Paradigms,
Technologies,
or a class of such platforms. The platform is listed along with how frequently the given
weakness appears for that instance.
Languages C (Undetermined Prevalence)
C++ (Undetermined Prevalence)
Example 1
The following code attempts to create a local copy of a buffer to perform some manipulations to the data.
(bad code)Example Language: Cvoid manipulate_string(char * string){char buf[24];}
strcpy(buf, string);
...However, the programmer does not ensure that the size of the data pointed to by string will fit in the local buffer and copies the data with the potentially dangerous strcpy() function. This may result in a buffer overflow condition if an attacker can influence the contents of the string parameter.
Note: this is a curated list of examples for users to understand the variety of ways in which this weakness can be introduced. It is not a complete list of all CVEs that are related to this CWE entry.
Reference Description Library has multiple buffer overflows using sprintf() and strcpy()Buffer overflow using strcat()Buffer overflow using strcpy()Buffer overflow using strcpy()Vulnerable use of strcpy() changed to use safer strlcpy()Buffer overflow using strcpy()Ordinality Description Primary(where the weakness exists independent of other weaknesses)Indirect(where the weakness is a quality issue that might indirectly make it easier to introduce security-relevant weaknesses or make them more difficult to detect)Method Details Automated Static Analysis - Binary or Bytecode
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:- Bytecode Weakness Analysis - including disassembler + source code weakness analysis
- Binary Weakness Analysis - including disassembler + source code weakness analysis
Cost effective for partial coverage:- Binary / Bytecode Quality Analysis
- Binary / Bytecode simple extractor - strings, ELF readers, etc.
Effectiveness: High
Manual Static Analysis - Binary or Bytecode
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:- Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies
Effectiveness: SOAR Partial
Dynamic Analysis with Manual Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:- Debugger
Cost effective for partial coverage:- Monitored Virtual Environment - run potentially malicious code in sandbox / wrapper / virtual machine, see if it does anything suspicious
Effectiveness: High
Manual Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:- Manual Source Code Review (not inspections)
Cost effective for partial coverage:- Focused Manual Spotcheck - Focused manual analysis of source
Effectiveness: High
Automated Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:- Source code Weakness Analyzer
- Context-configured Source Code Weakness Analyzer
Cost effective for partial coverage:- Warning Flags
- Source Code Quality Analyzer
Effectiveness: High
Automated Static Analysis
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:- Origin Analysis
Effectiveness: SOAR Partial
Architecture or Design Review
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:- Formal Methods / Correct-By-Construction
- Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
Effectiveness: High
This MemberOf Relationships table shows additional CWE Categories and Views that
reference this weakness as a member. This information is often useful in understanding where a
weakness fits within the context of external information sources.
Nature Type ID Name MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.738 CERT C Secure Coding Standard (2008) Chapter 5 - Integers (INT) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.743 CERT C Secure Coding Standard (2008) Chapter 10 - Input Output (FIO) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.746 CERT C Secure Coding Standard (2008) Chapter 13 - Error Handling (ERR) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.865 2011 Top 25 - Risky Resource Management MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.872 CERT C++ Secure Coding Section 04 - Integers (INT) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.877 CERT C++ Secure Coding Section 09 - Input Output (FIO) MemberOf
View - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries).884 CWE Cross-section MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.1001 SFP Secondary Cluster: Use of an Improper API MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.1161 SEI CERT C Coding Standard - Guidelines 07. Characters and Strings (STR) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.1165 SEI CERT C Coding Standard - Guidelines 10. Environment (ENV) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.1167 SEI CERT C Coding Standard - Guidelines 12. Error Handling (ERR) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.1169 SEI CERT C Coding Standard - Guidelines 14. Concurrency (CON) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.1170 SEI CERT C Coding Standard - Guidelines 48. Miscellaneous (MSC) MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.1412 Comprehensive Categorization: Poor Coding Practices MemberOf
Category - a CWE entry that contains a set of other entries that share a common characteristic.1441 OWASP Top Ten 2025 Category A06:2025 - Insecure Design Usage ALLOWED (this CWE ID may be used to map to real-world vulnerabilities)Reason Acceptable-Use Rationale
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities. Comments
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction. Relationship
This weakness is different than CWE-242 (Use of Inherently Dangerous Function). CWE-242 covers functions with such significant security problems that they can never be guaranteed to be safe. Some functions, if used properly, do not directly pose a security risk, but can introduce a weakness if not called correctly. These are regarded as potentially dangerous. A well-known example is the strcpy() function. When provided with a destination buffer that is larger than its source, strcpy() will not overflow. However, it is so often misused that some developers prohibit strcpy() entirely.Mapped Taxonomy Name Node ID Fit Mapped Node Name 7 Pernicious Kingdoms Dangerous Functions CERT C Secure Coding CON33-C CWE More Abstract Avoid race conditions when using library functions CERT C Secure Coding ENV33-C CWE More Abstract Do not call system() CERT C Secure Coding ERR07-C Prefer functions that support error checking over equivalent functions that don't CERT C Secure Coding ERR34-C CWE More Abstract Detect errors when converting a string to a number CERT C Secure Coding FIO01-C Be careful using functions that use file names for identification CERT C Secure Coding MSC30-C CWE More Abstract Do not use the rand() function for generating pseudorandom numbers CERT C Secure Coding STR31-C Imprecise Guarantee that storage for strings has sufficient space for character data and the null terminator Software Fault Patterns SFP3 Use of an improper API [REF-6] Katrina Tsipenyuk, Brian Chess and Gary McGraw. "Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors". NIST Workshop on Software Security Assurance Tools Techniques and Metrics. NIST. 2005-11-07.
<https://samate.nist.gov/SSATTM_Content/papers/Seven%20Pernicious%20Kingdoms%20-%20Taxonomy%20of%20Sw%20Security%20Errors%20-%20Tsipenyuk%20-%20Chess%20-%20McGraw.pdf>.[REF-554] Michael Howard. "Security Development Lifecycle (SDL) Banned Function Calls". 2011-06.
<https://learn.microsoft.com/en-us/previous-versions/bb288454(v=msdn.10)?redirectedfrom=MSDN>. (URL validated: 2026-04-24)[REF-1009] Tim Rains. "Microsoft's Free Security Tools - banned.h". 2012-08-30.
<https://www.microsoft.com/en-us/security/blog/2012/08/30/microsofts-free-security-tools-banned-h/>. (URL validated: 2026-04-24)[REF-7] Michael Howard and David LeBlanc. "Writing Secure Code". Chapter 5, "Safe String Handling" Page 156, 160. 2nd Edition. Microsoft Press. 2002-12-04.
<https://www.microsoftpressstore.com/store/writing-secure-code-9780735617223>.[REF-62] Mark Dowd, John McDonald and Justin Schuh. "The Art of Software Security Assessment". Chapter 8, "C String Handling", Page 388. 1st Edition. Addison Wesley. 2006. [REF-1479] Gregory Larsen, E. Kenneth Hong Fong, David A. Wheeler and Rama S. Moorthy. "State-of-the-Art Resources (SOAR) for Software Vulnerability Detection, Test, and Evaluation". 2014-07.
<https://www.ida.org/-/media/feature/publications/s/st/stateoftheart-resources-soar-for-software-vulnerability-detection-test-and-evaluation/p-5061.ashx>. (URL validated: 2025-09-05)More information is available — Please edit the custom filter or select a different filter.Page Last Updated: April 30, 2026Use of the Common Weakness Enumeration (CWE™) and the associated references from this website are subject to the Terms of Use. CWE is sponsored by the U.S. Department of Homeland Security (DHS) Cybersecurity and Infrastructure Security Agency (CISA) and managed by the Homeland Security Systems Engineering and Development Institute (HSSEDI) which is operated by The MITRE Corporation (MITRE). Copyright © 2006–2026, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation.



