# 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