This weakness occurs when a Java application directly calls native code through the Java Native Interface (JNI), exposing the entire application to security risks present in that external code, even if Java itself is safe from those specific flaws.
Using JNI bypasses the critical security safeguards built into the Java runtime. Native code operates outside the protections of Java's memory management, strong type checking, and automatic array bounds validation. This means vulnerabilities like buffer overflows, which Java prevents, become possible and can compromise your application. You must manually audit all native code called via JNI, as you cannot rely on Java's runtime security. The languages used for native implementations (like C/C++) often require careful manual memory and input validation. A flaw in the native component can undermine the security of your entire Java application.
Impact: Bypass Protection Mechanism
Strategy: Refactoring
Strategy: Refactoring
javac