<?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>Npm:praisonai (&gt;= 1.2.3, &lt;= 1.7.1) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/npmpraisonai--1.2.3--1.7.1/</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>Thu, 18 Jun 2026 15:04:55 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/npmpraisonai--1.2.3--1.7.1/feed.xml" rel="self" type="application/rss+xml"/><item><title>npm PraisonAI SandboxExecutor allowedCommands bypass via shell chaining</title><link>https://feed.craftedsignal.io/briefs/2026-06-npm-praisonai-sandboxexecutor-bypass/</link><pubDate>Thu, 18 Jun 2026 15:04:55 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-06-npm-praisonai-sandboxexecutor-bypass/</guid><description>A critical command injection vulnerability exists in the `npm:praisonai` package versions &gt;= 1.2.3 and &lt;= 1.7.1, where the `SandboxExecutor`'s `allowedCommands` policy is bypassed by allowing arbitrary shell command chaining after an allowlisted command, leading to remote code execution with the PraisonAI process privileges.</description><content:encoded><![CDATA[<p>The <code>npm:praisonai</code> package, which provides &quot;safe command execution with restrictions&quot; via its <code>SandboxExecutor</code> and <code>CommandValidator</code> components, contains a critical vulnerability affecting versions 1.2.3 through 1.7.1. The <code>CommandValidator</code> component incorrectly processes command strings when <code>allowedCommands</code> is configured: it only checks the first whitespace-delimited token for allowlisting, while the <code>SandboxExecutor</code> subsequently passes the entire, unmodified command string to <code>spawn(&quot;sh&quot;, [&quot;-c&quot;, command])</code>. This discrepancy allows attackers to append arbitrary shell commands using metacharacters (e.g., <code>;</code>, <code>&amp;&amp;</code>, <code>||</code>) after an allowlisted initial command, bypassing the intended security controls. This allows for arbitrary code execution with the privileges of the PraisonAI process if lower-trust input (such as user prompts or model output) is processed by the vulnerable component. The vulnerability is present in <code>src/praisonai-ts/src/cli/features/sandbox-executor.ts</code> and confirmed in distributed <code>npm:praisonai@1.7.1</code> files.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious command string that begins with an allowlisted command (e.g., <code>echo</code>) followed by shell metacharacters and arbitrary commands (e.g., <code>echo allowed; cat /tmp/marker</code>).</li>
<li>This malicious command string is supplied as input to an application, CLI tool, or agent pipeline that utilizes the <code>npm:praisonai</code> library's <code>SandboxExecutor</code> or <code>sandboxExec</code> function.</li>
<li>The <code>CommandValidator</code> component within <code>praisonai</code> receives the command string and checks its <code>allowedCommands</code> policy by extracting only the first whitespace-delimited token (e.g., <code>echo</code>).</li>
<li>If the first token matches an entry in the <code>allowedCommands</code> list, the <code>CommandValidator</code> incorrectly deems the entire command string valid and permits its execution.</li>
<li>The <code>SandboxExecutor</code> proceeds to invoke <code>spawn('sh', ['-c', malicious_command_string])</code>, passing the full, unvalidated string directly to the system shell.</li>
<li>The <code>sh</code> process interprets the shell metacharacter (e.g., <code>;</code>) as a command separator, executing both the initially allowlisted command and the subsequent arbitrary malicious commands (e.g., <code>cat /tmp/marker</code>).</li>
<li>The attacker achieves arbitrary command execution with the privileges of the PraisonAI process, enabling actions such as reading or modifying files, invoking local tools, or causing denial of service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The successful exploitation of this vulnerability allows for arbitrary shell command execution within the context of the PraisonAI process. Depending on the privileges of the hosting application and the affected system, this can lead to severe consequences, including unauthorized access to sensitive data (confidentiality), modification or deletion of critical files (integrity), and disruption of service (availability). If the PraisonAI application handles lower-trust input, such as from user prompts or AI model outputs, the risk of compromise is significantly elevated. While the advisory notes a local-only proof-of-concept, the nature of the vulnerability means that any application exposing <code>SandboxExecutor</code>'s functionality to external input could be at risk.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade <code>npm:praisonai</code> to a patched version once available. Monitor the official GitHub advisory GHSA-vjv9-7m7j-h833 for release information.</li>
<li>Deploy the provided Sigma rule &quot;Detect Suspicious <code>sh -c</code> Spawns by Node.js with Shell Chaining&quot; to your SIEM system to identify attempts at exploiting this vulnerability.</li>
<li>Enable comprehensive <code>process_creation</code> logging on all Linux systems running Node.js applications that might utilize <code>npm:praisonai</code> or similar command execution libraries.</li>
<li>Review applications using <code>npm:praisonai</code> versions &gt;= 1.2.3, &lt;= 1.7.1 to ensure that any input passed to <code>SandboxExecutor</code> or <code>sandboxExec</code> is strictly validated and sanitized, avoiding shell metacharacters.</li>
<li>As a temporary mitigation, if direct patching is not immediately feasible, consider implementing input sanitization at the application layer to strip or escape shell metacharacters before passing commands to <code>npm:praisonai</code> functions.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>command-injection</category><category>npm</category><category>nodejs</category><category>sandbox-bypass</category><category>vulnerability</category><category>rce</category><category>server-side</category></item></channel></rss>