| Impact | Details |
|---|---|
|
Varies by Context |
Scope: Other |
| Phase(s) | Mitigation |
|---|---|
|
Implementation; Requirements |
Ban the use of dangerous functions. Use their safe equivalent.
|
|
Testing |
Use grep or static analysis tools to spot usage of dangerous functions.
|
| 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 |
| 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 code below calls gets() to read information into a buffer.
The gets() function in C is inherently unsafe.
Example 2
The code below calls the gets() function to read in data from the command line.
However, gets() is inherently unsafe, because it copies all input from STDIN to the buffer without checking size. This allows the user to provide a string that is larger than the buffer size, resulting in an overflow condition.
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 |
|---|---|
|
FTP client uses inherently insecure gets() function and is setuid root on some systems, allowing buffer overflow
|
| Ordinality | Description |
|---|---|
|
Primary
|
(where the weakness exists independent of other weaknesses)
|
| Method | Details |
|---|---|
|
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 |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 227 | 7PK - API Abuse |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 748 | CERT C Secure Coding Standard (2008) Appendix - POSIX (POS) |
| 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. | 1171 | SEI CERT C Coding Standard - Guidelines 50. POSIX (POS) |
| 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.| Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
|---|---|---|---|
| 7 Pernicious Kingdoms | Dangerous Functions | ||
| CERT C Secure Coding | POS33-C | CWE More Abstract | Do not use vfork() |
| Software Fault Patterns | SFP3 | Use of an improper API |
| Submissions | |||
|---|---|---|---|
| Submission Date | Submitter | Organization | |
|
2006年07月19日
(CWE Draft 3, 2006年07月19日) |
7 Pernicious Kingdoms | ||
| Modifications | |||
| Modification Date | Modifier | Organization | |
|
2024年02月29日
(CWE 4.14, 2024年02月29日) |
CWE Content Team | MITRE | |
| updated Observed_Examples | |||
| 2023年06月29日 | CWE Content Team | MITRE | |
| updated Mapping_Notes | |||
| 2023年04月27日 | CWE Content Team | MITRE | |
| updated Detection_Factors, Relationships | |||
| 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 References, Relationships | |||
| 2019年01月03日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2018年03月27日 | CWE Content Team | MITRE | |
| updated References | |||
| 2017年11月08日 | CWE Content Team | MITRE | |
| updated Causal_Nature, References, Relationships, Taxonomy_Mappings | |||
| 2014年07月30日 | CWE Content Team | MITRE | |
| updated Demonstrative_Examples, Relationships, Taxonomy_Mappings | |||
| 2012年10月30日 | CWE Content Team | MITRE | |
| updated Potential_Mitigations | |||
| 2012年05月11日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2011年06月27日 | CWE Content Team | MITRE | |
| updated Common_Consequences | |||
| 2011年06月01日 | CWE Content Team | MITRE | |
| updated Common_Consequences | |||
| 2010年04月05日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2010年02月16日 | CWE Content Team | MITRE | |
| updated Demonstrative_Examples, References, Relationships | |||
| 2009年10月29日 | CWE Content Team | MITRE | |
| updated Description, Other_Notes, References | |||
| 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, Type, Weakness_Ordinalities | |||
| 2008年07月01日 | Eric Dalci | Cigital | |
| updated Potential_Mitigations | |||
| 2008年07月01日 | Sean Eidemiller | Cigital | |
| added/updated demonstrative examples | |||
| Previous Entry Names | |||
| Change Date | Previous Entry Name | ||
| 2008年01月30日 | Dangerous Functions | ||
| 2008年04月11日 | Use of Inherently Dangerous Functions | ||
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.