# Email Header Injection - ID: go-email-header-injection - Severity: HIGH - CWE: CWE-93 (CWE-93) - Languages: Go - Frameworks: go, gin, echo, fiber, chi ## Description User input flows into email headers without CRLF validation. ## Detection Message User input from {source} flows to email operation at {sink} without sanitization. This can allow attackers to inject email headers via CRLF sequences. ## Remediation Reject input containing CRLF characters and validate email addresses. ```go func sanitizeHeader(s string) (string, error) { if strings.ContainsAny(s, "\r\n") { return "", errors.New("invalid characters") } return s, nil } subject, err := sanitizeHeader(r.FormValue("subject")) if err != nil { http.Error(w, "Invalid input", 400) return } ``` Learn more: https://shoulder.dev/learn/go/cwe-93/email-header-injection ## Documentation [object Object] ## Related Rules - **Email Header Injection** [HIGH]: - **Email Header Injection** [HIGH]: