| 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-7]
|
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Class 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 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 |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | Category Category - a CWE entry that contains a set of other entries that share a common characteristic. | 1228 | API / Function Errors |
| Phase | Note |
|---|---|
| Implementation |
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.
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:
Cost effective for partial coverage:
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:
Effectiveness: SOAR Partial |
|
Dynamic Analysis with Manual Results Interpretation |
According to SOAR [REF-1479], the following detection techniques may be useful: Highly cost effective:
Cost effective for partial coverage:
Effectiveness: High |
|
Manual Static Analysis - Source Code |
According to SOAR [REF-1479], the following detection techniques may be useful: Highly cost effective:
Cost effective for partial coverage:
Effectiveness: High |
|
Automated Static Analysis - Source Code |
According to SOAR [REF-1479], the following detection techniques may be useful: Highly cost effective:
Cost effective for partial coverage:
Effectiveness: High |
|
Automated Static Analysis |
According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage:
Effectiveness: SOAR Partial |
|
Architecture or Design Review |
According to SOAR [REF-1479], the following detection techniques may be useful: Highly cost effective:
Effectiveness: High |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | CategoryCategory - 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 | CategoryCategory - 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 | CategoryCategory - 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 | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 865 | 2011 Top 25 - Risky Resource Management |
| MemberOf | CategoryCategory - 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 | CategoryCategory - 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 | ViewView - 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 | CategoryCategory - 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 | CategoryCategory - 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 | CategoryCategory - 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 | CategoryCategory - 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 | CategoryCategory - 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 | CategoryCategory - 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 | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1412 | Comprehensive Categorization: Poor Coding Practices |
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
| 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 |
| Submissions | ||
|---|---|---|
| Submission Date | Submitter | Organization |
|
2008年04月11日
(CWE Draft 9, 2008年04月11日) |
7 Pernicious Kingdoms | |
| Modifications | ||
| Modification Date | Modifier | Organization |
|
2025年09月09日
(CWE 4.18, 2025年09月09日) |
CWE Content Team | MITRE |
| updated Detection_Factors, References | ||
| 2023年06月29日 | CWE Content Team | MITRE |
| updated Mapping_Notes | ||
| 2023年04月27日 | CWE Content Team | MITRE |
| updated References, Relationships, Time_of_Introduction | ||
| 2023年01月31日 | CWE Content Team | MITRE |
| updated Description | ||
| 2021年03月15日 | CWE Content Team | MITRE |
| updated Demonstrative_Examples | ||
| 2020年12月10日 | CWE Content Team | MITRE |
| updated Demonstrative_Examples | ||
| 2020年02月24日 | CWE Content Team | MITRE |
| updated Detection_Factors, References, Relationships | ||
| 2019年01月03日 | CWE Content Team | MITRE |
| updated Relationships, Weakness_Ordinalities | ||
| 2018年03月27日 | CWE Content Team | MITRE |
| updated References | ||
| 2017年11月08日 | CWE Content Team | MITRE |
| updated Causal_Nature, References, Relationships, Taxonomy_Mappings | ||
| 2017年05月03日 | CWE Content Team | MITRE |
| updated Related_Attack_Patterns | ||
| 2014年07月30日 | CWE Content Team | MITRE |
| updated Detection_Factors, Relationships, Taxonomy_Mappings | ||
| 2012年05月11日 | CWE Content Team | MITRE |
| updated References, Related_Attack_Patterns, Relationships, Weakness_Ordinalities | ||
| 2011年09月13日 | CWE Content Team | MITRE |
| updated Potential_Mitigations, Relationships, Taxonomy_Mappings | ||
| 2011年06月27日 | CWE Content Team | MITRE |
| updated Common_Consequences, Observed_Examples, Potential_Mitigations, References, Relationships | ||
| 2011年06月01日 | CWE Content Team | MITRE |
| updated Common_Consequences | ||
| 2010年02月16日 | CWE Content Team | MITRE |
| updated Demonstrative_Examples, Other_Notes, References, Relationship_Notes | ||
| 2009年07月27日 | CWE Content Team | MITRE |
| updated Relationships | ||
| 2008年11月24日 | CWE Content Team | MITRE |
| updated Relationships, Taxonomy_Mappings | ||
| 2008年09月08日 | CWE Content Team | MITRE |
| updated Applicable_Platforms, Relationships, Other_Notes, Taxonomy_Mappings, Weakness_Ordinalities | ||
| 2008年07月01日 | Eric Dalci | Cigital |
| updated Potential_Mitigations, Time_of_Introduction | ||
| 2008年07月01日 | Sean Eidemiller | Cigital |
| added/updated demonstrative examples | ||
Use 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–2025, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation.