# Improper Certificate Validation (CWE-295) The product does not validate, or incorrectly validates, a certificate. **Stack:** JavaScript - Prevalence: 보통 3개 언어 지원 - Impact: 높음 4개의 높은 심각도 규칙 - Prevention: 문서화됨 4개의 수정 예시 **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 1개의 Shoulder 탐지 규칙을 기반으로 한 Improper Certificate Validation 예방 전략. ### JavaScript Keep certificate verification enabled and enforce TLS 1.2 or higher ## Warning Signs - [HIGH] insecure TLS/SSL configurations in Node ## Consequences - 보호 메커니즘 우회 - 애플리케이션 데이터 읽기 - 애플리케이션 데이터 수정 ## Mitigations - 인증서는 신중히 관리하고 여전히 유효한지 확인하세요 - 인증서 피닝을 사용한다면 올바르게 구현되었는지 확인하세요 - SSL/TLS 클라이언트 인증서 검증을 올바르게 사용하세요 ## Detection - Total rules: 4 - Languages: go, javascript, typescript, python ## Rules by Language ### Javascript (1 rules) - **Insecure TLS/SSL Configuration** [HIGH]: Detects insecure TLS/SSL configurations in Node.js applications that weaken transport security. Common misconfigurations: - rejectUnauthorized: false (disables certificate validation) - NODE_TLS_REJECT_UNAUTHORIZED=0 (globally disables TLS verification) - Weak TLS versions (TLS 1.0, 1.1) - Insecure SSL options in HTTPS requests These misconfigurations allow man-in-the-middle attacks. - Remediation: Keep certificate verification enabled and use TLS 1.2 or higher. ```javascript const agent = new https.Agent({ rejectUnauthorized: true, minVersion: 'TLSv1.2' }); ``` Learn more: https://shoulder.dev/learn/javascript/cwe-295/insecure-tls-config ### Typescript (1 rules) - **Insecure TLS/SSL Configuration** [HIGH]: Detects insecure TLS/SSL configurations in Node.js applications that weaken transport security. Common misconfigurations: - rejectUnauthorized: false (disables certificate validation) - NODE_TLS_REJECT_UNAUTHORIZED=0 (globally disables TLS verification) - Weak TLS versions (TLS 1.0, 1.1) - Insecure SSL options in HTTPS requests These misconfigurations allow man-in-the-middle attacks. - Remediation: Keep certificate verification enabled and use TLS 1.2 or higher. ```javascript const agent = new https.Agent({ rejectUnauthorized: true, minVersion: 'TLSv1.2' }); ``` Learn more: https://shoulder.dev/learn/javascript/cwe-295/insecure-tls-config