---
title: "CWE-676: Use of Potentially Dangerous Function"
url: https://radicalnotion.ai/cwe/cwe-676
type: cwe
description: "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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-676: Use of Potentially Dangerous Function

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **Likelihood of exploit:** High
- **CVEs with this as primary weakness:** 12
- **Of those, in CISA KEV:** 0
- **New in 2026:** 4
- **CWE catalog version:** 4.21

## Description

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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Languages:** C (Undetermined), C++ (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Varies by Context, Quality Degradation, Unexpected State | If the function is used incorrectly, then it could result in security problems. |

## Potential mitigations

### 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\]

## Detection methods

### 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:

- Bytecode Weakness Analysis - including disassembler + source code weakness analysis
- Binary Weakness Analysis - including disassembler + source code weakness analysis
- 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:

Cost effective for partial coverage:

- Debugger
- 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:

Cost effective for partial coverage:

- Manual Source Code Review (not inspections)
- 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:

Cost effective for partial coverage:

- Source code Weakness Analyzer
- Context-configured Source Code Weakness Analyzer
- 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

## Demonstrative examples

### Example 1

The following code attempts to create a local copy of a buffer to perform some manipulations to the data.

Bad code:

```c
void 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.

## Observed examples

| CVE | Description |
| --- | --- |
| 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() |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2021-27474 | Rockwell Automation FactoryTalk AssetCentre Use of Potentially Dangerous Function | critical | 10.0 | - | No | 2022-03-23 |
| CVE-2026-14501 | Use of Potentially Dangerous Functionthat in IBM Db2 Genius Hub | critical | 9.8 | - | No | 2026-07-17 |
| CVE-2025-14601 | vsDesk Task Scheduler OS Command Injection | high | 8.6 | - | No | 2026-08-20 |
| CVE-2025-65117 | AVEVA Process Optimization Use of Potentially Dangerous Function | high | 8.5 | - | No | 2026-01-16 |
| CVE-2023-54216 | net/mlx5e: TC, Fix using eswitch mapping in nic mode | high | 7.8 | - | No | 2025-12-30 |
| CVE-2022-4499 | The strcmp function in TP-Link routers, Archer C5 and WR710N-V1, used for checking credentials in httpd, is susceptible to a side-channel attack. | high | 7.5 | - | No | 2023-01-11 |
| CVE-2022-39063 | - | high | 7.5 | - | No | 2022-09-16 |
| CVE-2020-14058 | squid: DoS in TLS handshake | high | 7.5 | - | No | 2020-06-30 |
| CVE-2024-38434 | Unitronics Vision PLC - CWE-676: Use of Potentially Dangerous Function | medium | 6.5 | - | No | 2024-07-21 |
| CVE-2024-50307 | Chatwork Desktop Application (Windows) uses a potentially dangerous function | medium | 5.5 | - | No | 2024-10-28 |
| CVE-2025-67604 | - | medium | 5.2 | - | No | 2026-05-12 |
| CVE-2024-37387 | - | medium | 4.0 | - | No | 2024-06-19 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-1177](https://radicalnotion.ai/cwe/cwe-1177) | Use of Prohibited Code |
| Child | [CWE-785](https://radicalnotion.ai/cwe/cwe-785) | Use of Path Manipulation Function without Maximum-sized Buffer |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| 7 Pernicious Kingdoms | Dangerous Functions | - | - |
| CERT C Secure Coding | Avoid race conditions when using library functions | CON33-C | CWE More Abstract |
| CERT C Secure Coding | Do not call system() | ENV33-C | CWE More Abstract |
| CERT C Secure Coding | Prefer functions that support error checking over equivalent functions that don't | ERR07-C | - |
| CERT C Secure Coding | Detect errors when converting a string to a number | ERR34-C | CWE More Abstract |
| CERT C Secure Coding | Be careful using functions that use file names for identification | FIO01-C | - |
| CERT C Secure Coding | Do not use the rand() function for generating pseudorandom numbers | MSC30-C | CWE More Abstract |
| CERT C Secure Coding | Guarantee that storage for strings has sufficient space for character data and the null terminator | STR31-C | Imprecise |
| Software Fault Patterns | Use of an improper API | SFP3 | - |

## Frequently asked questions

### What is CWE-676?

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.

### What CVEs are caused by CWE-676?

12 recorded CVEs are attributed to CWE-676, including CVE-2021-27474, CVE-2026-14501 and CVE-2025-14601.

### How do you prevent CWE-676?

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.

### How is CWE-676 detected?

Automated Static Analysis - Binary or Bytecode: According to SOAR, the following detection techniques may be useful:

### What are the consequences of CWE-676?

Exploiting CWE-676 can lead to: Varies by Context, Quality Degradation, Unexpected State.

### Is CWE-676 actively exploited?

12 recorded CVEs are caused by CWE-676; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/676.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-676). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
