PraisonAI Remote Code Execution via YAML Deserialization
PraisonAI is vulnerable to remote code execution (RCE) due to insecure YAML deserialization, allowing attackers to execute arbitrary code by uploading malicious agent definition files, affecting versions 4.5.114 and earlier.
CVE search metadata
CVE search record: CVE-2026-39890. KEV: no. Brief: PraisonAI Remote Code Execution via YAML Deserialization. Brief link: https://feed.craftedsignal.io/briefs/2024-01-02-praisonai-rce/
Triage facts
Revision 2- Evidence
- Unknown
- Severity
- Critical
- Sources
- 1 public source
- Freshness
- Revision 2Jan 2, 12:00 UTC
- Detection
- 2 rules
- Vulnerabilities
- 1 CVE
Revision history 1 entry · Revision 2
- Revision 2
Repaired a legacy canonical identity collision
Changed: slug
PraisonAI versions 4.5.114 and earlier are susceptible to remote code execution (RCE) due to unsafe handling of YAML deserialization. The vulnerability resides in the AgentService.loadAgentFromFile method, which uses the js-yaml library to parse YAML files without enforcing a safe schema. This allows an attacker to inject malicious YAML payloads containing JavaScript code (e.g., using the !!js/function tag) that is executed when the agent definition file is loaded. The attack vector involves uploading a crafted YAML file as an agent definition through a vulnerable API endpoint. Successful exploitation leads to arbitrary code execution on the server, potentially compromising the entire system.
Attack Chain
- Attacker identifies a PraisonAI instance running a vulnerable version (<= 4.5.114).
- Attacker crafts a malicious YAML file containing an embedded JavaScript payload using the
!!js/functiontag. The payload is designed to execute arbitrary commands on the server. - Attacker leverages an API endpoint that uses
AgentService.loadAgentFromFileto upload the malicious YAML file as an agent definition. - The PraisonAI server parses the uploaded YAML file using the vulnerable
js-yaml.loadfunction, without a safe schema. - The
!!js/functiontag triggers the execution of the embedded JavaScript code. - The attacker's payload executes arbitrary commands on the server, such as creating a file in the /tmp directory (as demonstrated in the PoC).
- Attacker achieves remote code execution and can perform actions such as data theft, installing backdoors, or further lateral movement within the network.
Impact
Successful exploitation of this vulnerability allows an attacker to execute arbitrary code on the PraisonAI server. This can lead to complete compromise of the server, including unauthorized access to sensitive data, installation of malware, and further network penetration. The vulnerability affects PraisonAI instances running version 4.5.114 and earlier, potentially impacting all users of the affected versions.
Recommendation
- Immediately upgrade PraisonAI to a patched version that addresses CVE-2026-39890.
- Deploy the provided Sigma rule
Detect Suspicious YAML Deserializationto identify attempts to exploit the vulnerability based on process creation events. - Modify the
AgentService.loadAgentFromFilemethod to usejs-yamlwith a safe schema such asJSON_SCHEMAas described in the advisory. - Implement strict input validation and sanitization for all file uploads, especially agent definition files, to prevent the injection of malicious YAML payloads.
- Implement access controls for API endpoints used to upload agent definitions to restrict access to trusted users only.
Detection coverage 2
Detect Suspicious YAML Deserialization
criticalDetects process creation initiated as a result of js-yaml deserializing a malicious YAML file. This may indicate an attempt to exploit a YAML deserialization vulnerability such as CVE-2026-39890.
Detect PraisonAI Malicious Agent Upload
highDetects creation of files in /tmp directory after praisonai executes node.
Detection queries are available on the platform. Get full rules →