<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Yaml Deserialization - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/yaml-deserialization/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/yaml-deserialization/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>PraisonAI Remote Code Execution via YAML Deserialization</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-praisonai-rce/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-02-praisonai-rce/</guid><description>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.</description><content:encoded><![CDATA[<p>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 <code>AgentService.loadAgentFromFile</code> method, which uses the <code>js-yaml</code> 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 <code>!!js/function</code> 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.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies a PraisonAI instance running a vulnerable version (&lt;= 4.5.114).</li>
<li>Attacker crafts a malicious YAML file containing an embedded JavaScript payload using the <code>!!js/function</code> tag. The payload is designed to execute arbitrary commands on the server.</li>
<li>Attacker leverages an API endpoint that uses <code>AgentService.loadAgentFromFile</code> to upload the malicious YAML file as an agent definition.</li>
<li>The PraisonAI server parses the uploaded YAML file using the vulnerable <code>js-yaml.load</code> function, without a safe schema.</li>
<li>The <code>!!js/function</code> tag triggers the execution of the embedded JavaScript code.</li>
<li>The attacker's payload executes arbitrary commands on the server, such as creating a file in the /tmp directory (as demonstrated in the PoC).</li>
<li>Attacker achieves remote code execution and can perform actions such as data theft, installing backdoors, or further lateral movement within the network.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>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.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Immediately upgrade PraisonAI to a patched version that addresses CVE-2026-39890.</li>
<li>Deploy the provided Sigma rule <code>Detect Suspicious YAML Deserialization</code> to identify attempts to exploit the vulnerability based on process creation events.</li>
<li>Modify the <code>AgentService.loadAgentFromFile</code> method to use <code>js-yaml</code> with a safe schema such as <code>JSON_SCHEMA</code> as described in the advisory.</li>
<li>Implement strict input validation and sanitization for all file uploads, especially agent definition files, to prevent the injection of malicious YAML payloads.</li>
<li>Implement access controls for API endpoints used to upload agent definitions to restrict access to trusted users only.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>rce</category><category>yaml deserialization</category><category>praisonai</category></item></channel></rss>