Cryptography Vulnerabilities
Overview
The Cryptography Vulnerabilities detection feature in BugZ focuses on identifying security risks related to cryptographic operations and protocols used in Python code. By detecting vulnerabilities such as weak cryptographic key usage, insecure SSL/TLS protocols, and unsafe YAML loading, BugZ helps developers ensure the integrity and confidentiality of their applications' data.
Vulnerabilities
3001: request_with_no_cert_validation
- Description: This vulnerability arises when HTTPS requests are made with certificate validation explicitly turned off (
verify=False). It poses a high-security risk as it disables SSL certificate checks, potentially exposing the application to man-in-the-middle attacks. - Severity: High
- CWE: CWE-295 (opens in a new tab)
- Reference Links:
3002: ssl_with_bad_version
- Description: This vulnerability detects the use of SSL/TLS protocols with known exploitable flaws, such as SSL v2, SSL v3, TLS v1, and TLS v1.1. It poses a high-security risk and recommends avoiding these protocol versions.
- Severity: High
- CWE: CWE-327 (opens in a new tab)
- Reference Links:
3003: ssl_with_bad_defaults
- Description: This vulnerability identifies the use of SSL/TLS protocols with default parameter values that specify the use of broken protocol versions. It poses a medium-security risk and recommends avoiding these default values.
- Severity: Medium
- CWE: CWE-327 (opens in a new tab)
- Reference Links:
3004: ssl_with_no_version
- Description: This vulnerability detects SSL/TLS methods that configure the version of SSL/TLS protocol to use without specifying a version. It poses a low-security risk, as the default SSLv23 may be insecure.
- Severity: Low
- CWE: CWE-327 (opens in a new tab)
- Reference Links:
3005: weak_cryptographic_key
- Description: This vulnerability identifies the use of cryptographic keys with lengths below recommended thresholds, making them susceptible to attacks. It poses a high-security risk for keys below the lower threshold and a medium risk for those below the higher threshold.
- Severity: High (for keys below lower threshold), Medium (for keys below higher threshold)
- CWE: CWE-326 (opens in a new tab)
- Reference Links:
3006: yaml_load
- Description: This vulnerability detects unsafe usage of the
yaml.loadfunction from the PyYAML package, which can lead to the instantiation of arbitrary objects. It recommends usingyaml.safe_loadfor safer YAML parsing. - Severity: Medium
- CWE: CWE-20 (opens in a new tab)
- Reference Links:
3007: ssh_no_host_key_verification
- Description: This vulnerability arises when SSH client policies are set to automatically trust unknown host keys, potentially exposing the application to man-in-the-middle attacks. It poses a high-security risk.
- Severity: High
- CWE: CWE-295 (opens in a new tab)
- Reference Links:
3008: snmp_insecure_version
- Description: This vulnerability detects the usage of insecure SNMP versions like v1 and v2c, recommending the use of SNMPv3 for improved security.
- Severity: Medium
- CWE: CWE-319 (opens in a new tab)
- Reference Links:
3009: snmp_weak_cryptography
- Description: This vulnerability detects the use of insecure SNMP cryptography, specifically the usage of SNMPv3 without encryption (noAuthNoPriv). It recommends using more secure configurations for SNMP.
- Severity: Medium
- CWE: CWE-319 (opens in a new tab)
- Reference Links:
Best Practices
- Regular Security Reviews: Conduct regular security reviews of cryptographic implementations to ensure compliance with best practices and security standards.
- Use Strong Cryptography: Always use strong cryptographic algorithms and key lengths recommended by industry standards.
- Secure Configuration: Configure SSL/TLS, SSH, and SNMP protocols securely, following best practices and recommendations from authoritative sources.
- Developer Training: Educate developers about secure cryptographic practices and encourage the use of secure libraries and functions.
By following these best practices and using BugZ, developers can enhance the security posture of their applications and protect sensitive data from unauthorized access or tampering.