Java Unsafe Tls Renegotiation Enabled
Description
Detects when unsafe TLS renegotiation is explicitly enabled in Java applications. Unsafe TLS renegotiation is a critical security vulnerability that makes TLS connections susceptible to man-in-the-middle attacks by allowing an attacker to inject arbitrary data into an encrypted session.
Detection Strategy
• Identifies calls to setProperty method in Java code
• Checks if the first argument matches 'sun.security.ssl.allowUnsafeRenegotiation' property name
• Verifies if the second argument is set to 'true', enabling unsafe renegotiation
• Reports a vulnerability when both conditions are found, indicating explicit enablement of unsafe TLS renegotiation
Vulnerable code example
public class TLSConfig {
public void configureSSL() {
// VULNERABLE: Enables unsafe TLS renegotiation which can lead to MITM attacks
System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", true);
}
}✅ Secure code example
public class TLSConfig {
public void configureSSL() {
// Disable unsafe TLS renegotiation to prevent MITM attacks
System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", false);
}
}Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.