# Improper Handling of Exceptional Conditions (CWE-755) The product does not handle or incorrectly handles an exceptional condition. **Stack:** Go - Prevalence: 보통 3개 언어 지원 - Impact: 높음 1개의 높은 심각도 규칙 - Prevention: 문서화됨 4개의 수정 예시 **OWASP:** Insecure Design (A04:2021-Insecure Design) - #4 ## Description When exceptional conditions are not properly handled, the product may enter an undefined state, crash, or expose sensitive information. This can lead to denial of service, information disclosure, or unexpected behavior. ## Prevention 1개의 Shoulder 탐지 규칙을 기반으로 한 Improper Handling of Exceptional Conditions 예방 전략. ### Go Always check error return values before using other results ## Consequences - DoS - 애플리케이션 데이터 읽기 - 승인되지 않은 코드 실행 ## Mitigations - 발생 가능한 모든 예외 상황을 예측하고 적절히 처리하세요 - try-catch 블록과 적절한 오류 처리 메커니즘을 사용하세요 - 예외 발생 시 안전하게 실패하도록 처리하세요 ## Detection - Total rules: 4 - Languages: go, javascript, typescript, python ## Rules by Language ### Go (1 rules) - **Incomplete Error Handling** [MEDIUM]: Function returns error but caller does not check err != nil. - Remediation: Check error return values before using other returned values. ```go result, err := process() if err != nil { return err } // Now safe to use result ``` Learn more: https://shoulder.dev/learn/go/cwe-755/incomplete-error-handling