Why this matters
Disabling SSL/TLS certificate validation exposes applications to Man-in-the-Middle (MitM) attacks, allowing attackers to intercept and manipulate sensitive data.
Ensure that SSL/TLS certificate validation is always enabled to prevent Man-in-the-Middle (MitM) attacks.
Disabling SSL/TLS certificate validation exposes applications to Man-in-the-Middle (MitM) attacks, allowing attackers to intercept and manipulate sensitive data.
Side-by-side examples engineers can pattern-match during review.
class TrustAllManager implements X509TrustManager {
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { // Noncompliant
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { // Noncompliant
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}// (no example provided)class TrustAllManager implements X509TrustManager {
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { // Noncompliant
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { // Noncompliant
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}From the same buckets as this rule.