CVE-2026-42168
9.1Django · django-pyas2
The django-pyas2 library is vulnerable to OS command injection via unsanitized Partner model fields, allowing arbitrary command execution on the host server.
Executive summary
A critical OS command injection vulnerability in django-pyas2 allows attackers to execute arbitrary code on the underlying server, posing a severe risk of total system compromise.
Vulnerability
The vulnerability exists because the cmd_receive and cmd_send fields on the Partner model are passed directly to os.system in pyas2/utils.py without input sanitization. Although the record mentions an authenticated admin, the provided CVSS vector (AV:N/AC:L/PR:N/UI:N) indicates this flaw is exploitable by an unauthenticated remote attacker.
Business impact
Successful exploitation grants an attacker the ability to execute arbitrary commands with the privileges of the application process. This can lead to full system compromise, exfiltration of sensitive AS2 transaction data, and complete loss of service integrity. Given the CVSS score of 9.1, this vulnerability represents a critical threat that must be addressed immediately to prevent unauthorized access and potential data breaches.
Remediation
Immediate Action: Since no official patched version is currently listed, users should restrict access to the affected Partner model configuration interfaces and monitor for unauthorized modifications. Review the provided fix commit (3d5c1f365a44dbb736d422950db357ff9b76ea83) to apply a manual patch to your local deployment.
Proactive Monitoring: Audit server logs for suspicious command-line activity or unexpected shell execution patterns initiated by the application user.
Compensating Controls: Implement a Web Application Firewall (WAF) to filter and block requests containing shell metacharacters in the Partner model configuration parameters.
Exploitation status
Public Exploit Available: Yes, a published PoC exists attributed to the researcher write-up linked in the CVE record.
Analyst recommendation
This vulnerability is critical and poses a significant risk to the availability and security of your infrastructure. We strongly recommend immediate code review and manual application of the upstream fix commit to sanitize inputs before they reach the system shell. Ensure that the application is running with the principle of least privilege to limit the potential impact of any successful command injection attempt.