<?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/"><channel><title>ERPNext — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/erpnext/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/erpnext/feed.xml" rel="self" type="application/rss+xml"/><item><title>Frappe Framework ERPNext 13.4.0 Sandbox Escape Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-frappe-rce/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-frappe-rce/</guid><description>Frappe Framework ERPNext 13.4.0 contains a sandbox escape vulnerability allowing authenticated users with System Manager role to execute arbitrary code via frame introspection and `os.popen`.</description><content:encoded><![CDATA[<p>Frappe Framework is an open-source web application framework, and ERPNext is an ERP system built on top of it. A critical vulnerability, CVE-2023-54345, exists in Frappe Framework ERPNext version 13.4.0 related to a sandbox escape in the RestrictedPython environment. This allows authenticated users with the System Manager role to bypass intended security restrictions and execute arbitrary code on the server. The vulnerability is rooted in the improper handling of frame introspection within RestrictedPython, enabling attackers to traverse the call stack and invoke dangerous functions like <code>os.popen</code>. Exploitation involves crafting malicious server-side scripts through the <code>/app/server-script</code> endpoint. Successful exploitation leads to complete server compromise.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker authenticates to the ERPNext system with a System Manager role.</li>
<li>The attacker creates a new server script via the <code>/app/server-script</code> endpoint.</li>
<li>The attacker crafts a malicious Python script designed to exploit the RestrictedPython sandbox.</li>
<li>The malicious script uses frame introspection to access the <code>gi_frame</code> attribute, allowing traversal of the call stack.</li>
<li>The script invokes <code>os.popen</code> (or a similar function) to execute arbitrary system commands.</li>
<li>The server executes the attacker-supplied commands with the privileges of the ERPNext application user.</li>
<li>The attacker gains control over the server, potentially installing malware, exfiltrating data, or causing denial of service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows attackers to execute arbitrary code on the server hosting the Frappe Framework ERPNext application. This can lead to full system compromise, data breaches, and denial of service. The vulnerability affects version 13.4.0 of ERPNext. If successfully exploited, threat actors can leverage the compromised system to pivot to other internal resources.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply available patches or upgrade to a patched version of Frappe Framework ERPNext to address CVE-2023-54345.</li>
<li>Monitor web server logs for unusual activity related to the <code>/app/server-script</code> endpoint.</li>
<li>Implement the provided Sigma rule to detect potential exploitation attempts based on <code>os.popen</code> usage within server scripts.</li>
<li>Review and restrict the permissions of the System Manager role to minimize the attack surface.</li>
<li>Deploy the second Sigma rule to detect suspicious process execution initiated by the ERPNext application user.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>sandbox-escape</category><category>rce</category><category>erpnext</category></item></channel></rss>