2 vulnerabilities classified as CWE-111 (对不安全JNI的直接使用). AI Chinese analysis included.
CWE-111, Direct Use of Unsafe JNI, is a critical weakness occurring when Java applications invoke native code via the Java Native Interface, thereby bypassing Java’s inherent safety mechanisms. This vulnerability typically arises because native languages like C or C++ lack memory safety guarantees, allowing attackers to exploit buffer overflows or memory corruption within the native layer to execute arbitrary code or crash the application. Since these flaws exist outside Java’s controlled environment, standard runtime protections often fail to detect them. Developers can mitigate this risk by rigorously validating all inputs passed to native functions, ensuring strict bounds checking, and minimizing the surface area of native code. Additionally, employing static analysis tools to scan native libraries and adhering to secure coding standards for C/C++ are essential practices to prevent unsafe interactions between Java and native environments.
class Echo { public native void runEcho(); static { System.loadLibrary("echo"); } public static void main(String[] args) { new Echo().runEcho(); } }#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); }| CVE ID | Title | CVSS | Severity | Published |
|---|---|---|---|---|
| CVE-2018-12549 | Eclipse OpenJ9 输入验证错误漏洞 — Eclipse OpenJ9 | 9.8 | - | 2019-02-11 |
| CVE-2016-9160 | SIMATIC WinCC和SIMATIC PCS 7 安全漏洞 — SIEMENS SIMATIC WinCC (All versions < SIMATIC WinCC V7.2) and SIEMENS SIMATIC PCS 7 (All versions < SIMATIC PCS 7 V8.0 SP1) | 8.1 | - | 2016-12-17 |
Vulnerabilities classified as CWE-111 (对不安全JNI的直接使用) represent 2 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.