---
title: "CWE-695: Use of Low-Level Functionality"
url: https://radicalnotion.ai/cwe/cwe-695
type: cwe
description: "The product uses low-level functionality that is explicitly prohibited by the framework or specification under which the product is supposed to operate."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-695: Use of Low-Level Functionality

- **Abstraction:** Base
- **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 low-level functionality that is explicitly prohibited by the framework or specification under which the product is supposed to operate.

## Modes of introduction

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

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Alter Execution Logic, Varies by Context, Unexpected State | The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack. |

## 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 following code defines a class named Echo. The class declares one native method (defined below), which uses C to echo commands entered on the console back to the user. The following C code defines the native method implemented in the Echo class:

Bad code:

```java
class Echo {

    public native void runEcho();
    static {

        System.loadLibrary("echo");
    }
    public static void main(String[] args) {

        new Echo().runEcho();
    }
}
```

Bad code:

```c
#include <jni.h>
#include "Echo.h"//the java class above compiled with javah
#include <stdio.h>

JNIEXPORT void JNICALL
Java_Echo_runEcho(JNIEnv *env, jobject obj)
{
    char buf[64];
    gets(buf);
    printf(buf);
}
```

### Example 2

The following example opens a socket to connect to a remote server.

Bad code:

```java
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    // Perform servlet tasks.
    ...

    // Open a socket to a remote server (bad).
    Socket sock = null;

    try {
        sock = new Socket(remoteHostname, 3000);

        // Do something with the socket.
        ...
    } catch (Exception e) {
        ...
    }
}
```

A Socket object is created directly within the Java servlet, which is a dangerous way to manage remote connections.

## Related attack patterns (CAPEC)

- [CAPEC-36](https://radicalnotion.ai/capec/capec-36): Using Unpublished Interfaces or Functionality

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-573](https://radicalnotion.ai/cwe/cwe-573) | Improper Following of Specification by Caller |
| Child | [CWE-111](https://radicalnotion.ai/cwe/cwe-111) | Direct Use of Unsafe JNI |
| Child | [CWE-245](https://radicalnotion.ai/cwe/cwe-245) | J2EE Bad Practices: Direct Management of Connections |
| Child | [CWE-246](https://radicalnotion.ai/cwe/cwe-246) | J2EE Bad Practices: Direct Use of Sockets |
| Child | [CWE-383](https://radicalnotion.ai/cwe/cwe-383) | J2EE Bad Practices: Direct Use of Threads |
| Child | [CWE-574](https://radicalnotion.ai/cwe/cwe-574) | EJB Bad Practices: Use of Synchronization Primitives |
| Child | [CWE-575](https://radicalnotion.ai/cwe/cwe-575) | EJB Bad Practices: Use of AWT Swing |
| Child | [CWE-576](https://radicalnotion.ai/cwe/cwe-576) | EJB Bad Practices: Use of Java I/O |
| Child | [CWE-577](https://radicalnotion.ai/cwe/cwe-577) | EJB Bad Practices: Use of Sockets |
| Child | [CWE-578](https://radicalnotion.ai/cwe/cwe-578) | EJB Bad Practices: Use of Class Loader |
| Child | [CWE-1065](https://radicalnotion.ai/cwe/cwe-1065) | Runtime Resource Management Control Element in a Component Built to Run on Application Servers |

## Frequently asked questions

### What is CWE-695?

The product uses low-level functionality that is explicitly prohibited by the framework or specification under which the product is supposed to operate.

### How is CWE-695 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-695?

Exploiting CWE-695 can lead to: Alter Execution Logic, Varies by Context, Unexpected State.

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

---

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