# Improper Neutralization of CRLF Sequences ('CRLF Injection') (CWE-93) The product uses CRLF (carriage return line feed) as a special element, e.g. to separate headers or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs. **Stack:** Python - Prevalence: मध्यम 3 भाषाएँ कवर की गईं - Impact: उच्च 3 उच्च गंभीरता वाले नियम - Prevention: प्रलेखित 3 फिक्स उदाहरण **OWASP:** Injection (A03:2021-Injection) - #3 ## Description CRLF injection can be used to inject malicious headers in HTTP responses (HTTP response splitting), forge log entries, or manipulate other protocols that use CRLF as a delimiter. ## Prevention 1 Shoulder डिटेक्शन नियमों पर आधारित CRLF Injection के लिए रोकथाम रणनीतियाँ। ### Python Strip newline characters from email headers before use ## Warning Signs - [HIGH] user input used in email headers without newline sanitization ## Consequences - एप्लिकेशन डेटा संशोधित करना - अनधिकृत कोड निष्पादित करना - गतिविधियाँ छिपाना ## Mitigations - हेडर या लॉग में उपयोग किए जाने वाले सभी इनपुट से CRLF अनुक्रमों को हटाएँ या एनकोड करें - ऐसे फ़्रेमवर्क का उपयोग करें जो स्वतः हेडर एनकोडिंग संभालते हैं - सत्यापित करें कि इनपुट में अप्रत्याशित नियंत्रण वर्ण न हों ## Detection - Total rules: 3 - Languages: go, javascript, typescript, python ## Rules by Language ### Python (1 rules) - **Email Header Injection** [HIGH]: Detects user input used in email headers without newline sanitization. - Remediation: Remove newlines from email headers before use. ```python safe_subject = subject.replace('\r', '').replace('\n', '') ``` Learn more: https://shoulder.dev/learn/python/cwe-93/email-injection