# Integer Overflow via Unchecked Arithmetic - ID: go-integer-overflow - Severity: MEDIUM - CWE: CWE-190 (CWE-190) - Languages: Go - Frameworks: stdlib, gin, echo, fiber, chi ## Description User-controlled integer used in arithmetic or allocation without bounds checking. ## Detection Message User input from {source} flows to arithmetic operation at {sink} without bounds validation. This could cause integer overflow leading to unexpected behavior or security bypass. ## Remediation Validate bounds before arithmetic operations with user input. ```go count, err := strconv.Atoi(r.URL.Query().Get("count")) if err != nil || count < 0 || count > 10000 { return errors.New("invalid count") } buffer := make([]byte, count*1024) ``` Learn more: https://shoulder.dev/learn/go/cwe-190/integer-overflow ## Documentation [object Object] ## Related Rules - **Integer Overflow via Unchecked Arithmetic** [MEDIUM]: - **Integer Overflow / Large Number Handling** [LOW]: