---
title: "CWE-1177: Use of Prohibited Code"
url: https://radicalnotion.ai/cwe/cwe-1177
type: cwe
description: "The product uses a function, library, or third party component that has been explicitly prohibited, whether by the developer or the customer."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1177: Use of Prohibited Code

- **Abstraction:** Class
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 0
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The product uses a function, library, or third party component that has been explicitly prohibited, whether by the developer or the customer.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Requirements | To reduce risk of vulnerabilities, the developer - or customers - may wish to restrict or eliminate use of a function, library, or third party component for any number of reasons, including real or suspected vulnerabilities; difficulty to use securely; export controls or license requirements; obsolete or poorly-maintained code; internal code being scheduled for deprecation; etc. This might be achieved using a list of "banned" functions that programmers must avoid using, because the functions are difficult or impossible to use securely. |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Reduce Maintainability | This issue can also make the product more costly and difficult to maintain. |

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

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

## Demonstrative examples

### Example 1

The code below calls the gets() function to read in data from the command line.

Bad code:

```c
    char buf[24];
    printf("Please enter your name and press <Enter>\n");
    gets(buf);
    ...
}
```

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.

### Example 2

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-2007-4004 | FTP client uses inherently insecure gets() function and is setuid root on some systems, allowing buffer overflow |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-710](https://radicalnotion.ai/cwe/cwe-710) | Improper Adherence to Coding Standards |
| Child | [CWE-242](https://radicalnotion.ai/cwe/cwe-242) | Use of Inherently Dangerous Function |
| Child | [CWE-676](https://radicalnotion.ai/cwe/cwe-676) | Use of Potentially Dangerous Function |

## Frequently asked questions

### What is CWE-1177?

The product uses a function, library, or third party component that has been explicitly prohibited, whether by the developer or the customer.

### How do you prevent CWE-1177?

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-1177 detected?

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.)

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

Exploiting CWE-1177 can lead to: Reduce Maintainability.

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

---

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