Browse our specialized collection of Java security rules designed to detect cryptographic vulnerabilities, secure communication issues, and OWASP Top 10 risks. Our rules help identify common security pitfalls in Java applications, with a focus on modern cryptography, secure networking, and industry best practices.
Severity: High | OWASP: Cryptographic Failures
Identifies usage of Math.random() which is not cryptographically secure and could lead to predictable values in security-critical contexts.
Insecure Random Example
// ❌ Vulnerable: Not cryptographically secure
doublevalue=Math.random();
// ✅ Safe: Using SecureRandom
SecureRandomsecureRandom=newSecureRandom();
doublevalue=secureRandom.nextDouble();
Weak Cryptography
Severity: High | OWASP: Cryptographic Failures
Detects usage of deprecated or weak cryptographic algorithms (RC4, RC2, SHA1, Blowfish) that are vulnerable to known attacks.
Severity: High | OWASP: Identification and Authentication Failures
Identifies usage of deprecated DefaultHttpClient which lacks modern security features and proper certificate validation.
HTTP Client Example
// ❌ Vulnerable: Deprecated client
HttpClientclient=newDefaultHttpClient();
// ✅ Safe: Modern HTTP client
HttpClientclient=HttpClientBuilder.create()
.setSSLContext(SSLContexts.createDefault())
.build();
Unencrypted Socket
Severity: High | OWASP: Cryptographic Failures
Detects usage of unencrypted socket connections that could expose sensitive data to network-level attacks.