CWE-111

Direct Use of Unsafe JNI

High

Description

When a Java application uses the Java Native Interface (JNI) to call code written in another programming language, it can expose the application to weaknesses in that code, even if those weaknesses cannot occur in Java.

Potential Impact

How to Fix

Implementation

Implement error handling around the JNI call.

Implementation

Do not use JNI calls if you don't trust the native library.

Implementation

Be reluctant to use JNI calls. A Java API equivalent may exist.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-111 vulnerabilities in your codebase.

Get Security Assessment