# 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: Mittel 3 Sprachen abgedeckt - Impact: Hoch 1 Regeln mit hohem Schweregrad - Prevention: Dokumentiert 3 Fix-Beispiele **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 Präventionsstrategien für Unchecked Error Condition basierend auf 1 Shoulder-Erkennungsregeln. ### Go Log or return errors instead of silently swallowing them ## Consequences - DoS - Nicht autorisierten Code ausführen - Anwendungsdaten ändern ## Mitigations - Alle Rückgabewerte und Fehlerbedingungen prüfen - Wo angemessen, Exception-Handling verwenden - Angemessene Mechanismen zur Fehlerwiederherstellung umsetzen ## 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