# Improper Certificate Validation (CWE-295) The product does not validate, or incorrectly validates, a certificate. **Stack:** Go - Prevalence: Średnia Pokryto 3 języków - Impact: Wysoki 4 reguł o wysokim poziomie - Prevention: Udokumentowane 4 przykładów poprawek **OWASP:** Identification and Authentication Failures (A07:2021-Identification and Authentication Failures) - #7 ## Description When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. ## Prevention Strategie zapobiegania dla Improper Certificate Validation oparte na 1 regułach detekcji Shoulder. ### Go Use TLS 1.2+ minimum version and always verify certificates ## Warning Signs - [HIGH] TLS configuration disables security features or uses weak settings ## Consequences - Obejście mechanizmu ochrony - Odczyt danych aplikacji - Modyfikacja danych aplikacji ## Mitigations - Certyfikaty należy starannie zarządzać i sprawdzać, czy nadal są ważne - Jeśli stosowany jest certificate pinning, upewnij się, że jest poprawnie wdrożony - Poprawnie stosuj walidację certyfikatów klienta SSL/TLS ## Detection - Total rules: 4 - Languages: go, javascript, typescript, python ## Rules by Language ### Go (1 rules) - **Insecure TLS/SSL Configuration** [HIGH]: TLS config uses InsecureSkipVerify, weak TLS version, or deprecated ciphers. - Remediation: Set MinVersion to TLS 1.2+ and never skip certificate verification. ```go tlsConfig := &tls.Config{ MinVersion: tls.VersionTLS12, InsecureSkipVerify: false, // Always verify certificates } ``` Learn more: https://shoulder.dev/learn/go/cwe-295/insecure-tls-config