# Unchecked Error Condition (CWE-391) The product does not properly check when a function or operation returns a value that is associated with an error condition. **Stack:** Go - Prevalence: 보통 3개 언어 지원 - Impact: 높음 1개의 높은 심각도 규칙 - Prevention: 문서화됨 3개의 수정 예시 **OWASP:** Insecure Design (A04:2021-Insecure Design) - #4 ## Description When error conditions are not checked, the application may continue with invalid or unexpected state, potentially leading to crashes, data corruption, or security vulnerabilities. ## Prevention 1개의 Shoulder 탐지 규칙을 기반으로 한 Unchecked Error Condition 예방 전략. ### Go Log or return errors instead of silently swallowing them ## Consequences - DoS - 승인되지 않은 코드 실행 - 애플리케이션 데이터 수정 ## Mitigations - 모든 반환값과 오류 조건을 확인하세요 - 필요한 곳에서는 예외 처리를 사용하세요 - 적절한 오류 복구 메커니즘을 구현하세요 ## Detection - Total rules: 3 - Languages: go, javascript, typescript, python ## Rules by Language ### Go (1 rules) - **Empty Error Handling** [LOW]: Error check block is empty, silently swallowing errors. - Remediation: Log or return errors instead of ignoring them silently. ```go if err != nil { log.Printf("operation failed: %v", err) return err } ``` Learn more: https://shoulder.dev/learn/go/cwe-391/empty-error-handling