CWE-676 Detalhe

CWE-676

Use of Potentially Dangerous Function
Alta
Draft
2008-04-11
00h00 +00:00
2025-12-11
00h00 +00:00
Notificações para um CWE
Fique informado sobre quaisquer alterações para um CWE específico.
Gerenciar notificações

Nome: Use of Potentially Dangerous Function

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.

Informações Gerais

Modos de Introdução

Implementation

Plataformas Aplicáveis

Linguagem

Name: C (Undetermined)
Name: C++ (Undetermined)

Consequências Comuns

Escopo Impacto Probabilidade
OtherVaries by Context, Quality Degradation, Unexpected State

Note: If the function is used incorrectly, then it could result in security problems.

Exemplos Observados

Referências Descrição

CVE-2007-1470

Library has multiple buffer overflows using sprintf() and strcpy()

CVE-2009-3849

Buffer overflow using strcat()

CVE-2006-2114

Buffer overflow using strcpy()

CVE-2006-0963

Buffer overflow using strcpy()

CVE-2011-0712

Vulnerable use of strcpy() changed to use safer strlcpy()

CVE-2008-5005

Buffer overflow using strcpy()

Mitigações Potenciais

Phases : 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]

Métodos de Detecção

Automated Static Analysis - Binary or Bytecode

Eficácia : High

Manual Static Analysis - Binary or Bytecode

Eficácia : SOAR Partial

Dynamic Analysis with Manual Results Interpretation

Eficácia : High

Manual Static Analysis - Source Code

Eficácia : High

Automated Static Analysis - Source Code

Eficácia : High

Automated Static Analysis

Eficácia : SOAR Partial

Architecture or Design Review

Eficácia : High

Notas de Mapeamento de Vulnerabilidade

Justificativa : 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.
Comentário : 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.

Notas

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.

Referências

REF-6

Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors
Katrina Tsipenyuk, Brian Chess, Gary McGraw.
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

Security Development Lifecycle (SDL) Banned Function Calls
Michael Howard.
https://learn.microsoft.com/en-us/previous-versions/bb288454(v=msdn.10)?redirectedfrom=MSDN

REF-7

Writing Secure Code
Michael Howard, David LeBlanc.
https://www.microsoftpressstore.com/store/writing-secure-code-9780735617223

REF-62

The Art of Software Security Assessment
Mark Dowd, John McDonald, Justin Schuh.

REF-1479

State-of-the-Art Resources (SOAR) for Software Vulnerability Detection, Test, and Evaluation
Gregory Larsen, E. Kenneth Hong Fong, David A. Wheeler, Rama S. Moorthy.
https://www.ida.org/-/media/feature/publications/s/st/stateoftheart-resources-soar-for-software-vulnerability-detection-test-and-evaluation/p-5061.ashx

Submissão

Nome Organização Data Data de lançamento Version
7 Pernicious Kingdoms 2008-04-11 +00:00 2008-04-11 +00:00 Draft 9

Modificações

Nome Organização Data Comentário
Sean Eidemiller Cigital 2008-07-01 +00:00 added/updated demonstrative examples
Eric Dalci Cigital 2008-07-01 +00:00 updated Potential_Mitigations, Time_of_Introduction
CWE Content Team MITRE 2008-09-08 +00:00 updated Applicable_Platforms, Relationships, Other_Notes, Taxonomy_Mappings, Weakness_Ordinalities
CWE Content Team MITRE 2008-11-24 +00:00 updated Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2009-07-27 +00:00 updated Relationships
CWE Content Team MITRE 2010-02-16 +00:00 updated Demonstrative_Examples, Other_Notes, References, Relationship_Notes
CWE Content Team MITRE 2011-06-01 +00:00 updated Common_Consequences
CWE Content Team MITRE 2011-06-27 +00:00 updated Common_Consequences, Observed_Examples, Potential_Mitigations, References, Relationships
CWE Content Team MITRE 2011-09-13 +00:00 updated Potential_Mitigations, Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2012-05-11 +00:00 updated References, Related_Attack_Patterns, Relationships, Weakness_Ordinalities
CWE Content Team MITRE 2014-07-30 +00:00 updated Detection_Factors, Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2017-05-03 +00:00 updated Related_Attack_Patterns
CWE Content Team MITRE 2017-11-08 +00:00 updated Causal_Nature, References, Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2018-03-27 +00:00 updated References
CWE Content Team MITRE 2019-01-03 +00:00 updated Relationships, Weakness_Ordinalities
CWE Content Team MITRE 2020-02-24 +00:00 updated Detection_Factors, References, Relationships
CWE Content Team MITRE 2020-12-10 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2021-03-15 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2023-01-31 +00:00 updated Description
CWE Content Team MITRE 2023-04-27 +00:00 updated References, Relationships, Time_of_Introduction
CWE Content Team MITRE 2023-06-29 +00:00 updated Mapping_Notes
CWE Content Team MITRE 2025-09-09 +00:00 updated Detection_Factors, References
CWE Content Team MITRE 2025-12-11 +00:00 updated Relationships