Insecure Random
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.
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.
To run these rules against your Java codebase:
codepathfinder ci --project /src/project --ruleset cpf/java
Browse our collection of Java security rules. Each rule includes example code and the actual rule implementation.
Insecure Random
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.
Blowfish Usage
Severity: High | OWASP: Cryptographic Failures
Detects usage of Blowfish encryption which uses a 64-bit block size, making it vulnerable to birthday attacks.
Default HTTP Client
Severity: High | OWASP: Identification and Authentication Failures
Identifies usage of deprecated DefaultHttpClient which lacks modern security features and proper certificate validation.
RC4 Usage
Severity: High | OWASP: Cryptographic Failures
Detects usage of RC4 cipher which is cryptographically broken and should not be used.
SHA-1 Usage
Severity: High | OWASP: Cryptographic Failures
Identifies usage of SHA-1 hash function which is cryptographically broken and should not be used.
Unencrypted Socket
Severity: High | OWASP: Cryptographic Failures
Detects usage of unencrypted Socket instead of SSLSocket for network communication.
XML External Entity (XXE)
Severity: High | OWASP: Injection
Identifies XML parsers that may be vulnerable to XXE attacks due to insecure configuration.
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.
Insecure HTTP Client
Severity: High | OWASP: Identification and Authentication Failures
Identifies usage of deprecated DefaultHttpClient which lacks modern security features and proper certificate validation.
Unencrypted Socket
Severity: High | OWASP: Cryptographic Failures
Detects usage of unencrypted socket connections that could expose sensitive data to network-level attacks.
XML External Entity (XXE) Vulnerability
Severity: High | OWASP: XML External Entities (XXE)
Identifies insecure XML parser configurations that could allow XXE attacks, potentially leading to data disclosure, denial of service, or server-side request forgery.
For more information on using Code PathFinder with Java, see our documentation.