Command Injection in Django
How Command Injection Manifests in Django
Command injection in Django applications typically occurs when user input is passed directly to system calls without proper sanitization. Django's architecture creates several unique attack vectors that developers must understand.
The most common pattern involves using Python's subprocess module within Django views or management commands. Developers often write code like:
Related CWEs: inputValidation
CWE ID Name Severity CWE-20 Improper Input Validation HIGH CWE-22 Path Traversal HIGH CWE-74 Injection CRITICAL CWE-77 Command Injection CRITICAL CWE-78 OS Command Injection CRITICAL CWE-79 Cross-site Scripting (XSS) HIGH CWE-89 SQL Injection CRITICAL CWE-90 LDAP Injection HIGH CWE-91 XML Injection HIGH CWE-94 Code Injection CRITICAL