|
Status: Draft Weakness ID: 242 (Weakness Base)Description Summary The program calls a function that can never be guaranteed to work safely. Likelihood of Exploit High Weakness Ordinalities Primary (where the weakness exists independent of other weaknesses) Causal Nature Explicit (an explicit
weakness resulting from behavior of the developer) Potential Mitigations Ban the use of dangerous function. Use their safe equivalent. Use grep or static analysis tools to spot usage of dangerous functions. Demonstrative Examples The excerpt below calls the gets() function in C, which is inherently unsafe. C Example: char buf[BUFSIZE]; gets(buf);
Other Notes Certain functions behave in dangerous ways regardless of how they are used. Functions in this category were often implemented without taking security concerns into account. The gets() function is unsafe because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to gets() and overflow the destination buffer. The > operator is unsafe to use when reading into a character buffer because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to the > operator and overflow the destination buffer. Relationships
Taxonomy Mappings
Applicable Platforms Languages C C++ Time of Introduction ImplementationContent History Submissions 7 Pernicious Kingdoms. (Externally Mined) Modifications Sean Eidemiller. Cigital. 2008-07-01. (External) added/updated demonstrative examples Eric Dalci. Cigital. 2008-07-01. (External) updated Potential_Mitigations CWE Content Team. MITRE. 2008-09-08. (Internal) updated Applicable_Platforms, Relationships, Other_Notes, Taxonomy_Mappings, Type, Weakness_Ordinalities Previous Entry Names Dangerous Functions (changed 2008-01-30) Use of Inherently Dangerous Functions (changed 2008-04-11) |
|
|
|||