# 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: Medium 3 languages covered - Impact: High 1 high-severity rules - Prevention: Documented 3 fix examples **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 Prevention strategies for Unchecked Error Condition based on 1 Shoulder detection rules. ### Go Log or return errors instead of silently swallowing them ## Consequences - DoS - Execute Unauthorized Code - Modify Application Data ## Mitigations - Check all return values and error conditions - Use exception handling where appropriate - Implement proper error recovery mechanisms ## 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