# Unchecked Return Value (CWE-252) The product does not check the return value from a method or function, which can prevent it from detecting unexpected states and conditions. **Stack:** Go - Prevalence: मध्यम 2 भाषाएँ कवर की गईं - Impact: उच्च 1 उच्च गंभीरता वाले नियम - Prevention: प्रलेखित 2 फिक्स उदाहरण **OWASP:** Insecure Design (A04:2021-Insecure Design) - #4 ## Description When return values are not checked, the program may continue execution in an error state or with incorrect data, potentially leading to security vulnerabilities. ## Prevention 1 Shoulder डिटेक्शन नियमों पर आधारित Unchecked Return Value के लिए रोकथाम रणनीतियाँ। ### Go Replace blank identifier _ with err and check error return values ## Consequences - DoS - अनधिकृत कोड निष्पादित करना - एप्लिकेशन डेटा संशोधित करना ## Mitigations - हमेशा फ़ंक्शनों के रिटर्न मानों की जाँच करें - अनचेक रिटर्न मानों का पता लगाने के लिए कंपाइलर चेतावनियों का उपयोग करें - त्रुटि स्थितियों को उचित रूप से संभालें ## Detection - Total rules: 2 - Languages: go, javascript, typescript ## Rules by Language ### Go (1 rules) - **Unchecked Error Return Values** [MEDIUM]: Error return value ignored using blank identifier (_). - Remediation: Check all error return values and handle appropriately. ```go data, err := ioutil.ReadFile(path) if err != nil { return fmt.Errorf("failed to read file: %w", err) } ``` Learn more: https://shoulder.dev/learn/go/cwe-252/unchecked-errors