Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. praisonai
  4. ›
  5. GHSA-5jv7-2mjm-h6qj

GHSA-5jv7-2mjm-h6qj: npm PraisonAI utility shell safe-command wrapper allowlist bypass via shell chaining

June 18, 2026 (updated July 20, 2026)

The published npm package praisonai ships dist/tools/utility-tools.js, which exports a shell(command) helper described in source as:

Execute shell command (safe version - read-only commands)

The helper attempts to enforce a safe read-only command allowlist by checking only the first whitespace-delimited token:

const safeCommands = ['ls', 'cat', 'head', 'tail', 'wc', 'grep', 'find', 'echo', 'date', 'pwd', 'which'];
const firstWord = command.split(/\s+/)[0];

if (!safeCommands.includes(firstWord)) {
return { success: false, error: `Command not allowed: ${firstWord}` };
}

It then passes the entire original string to Node child_process.exec():

const { stdout, stderr } = await execAsync(command, { timeout: 5000 });

Because exec() runs the command through a shell, a command string that starts with an allowed command can append a second non-allowlisted command with shell metacharacters. For example, direct printf <marker> is rejected, but echo ok; printf <marker> is accepted and executes printf.

This bypasses the helper’s safe-command policy and allows arbitrary shell commands to run with the PraisonAI process privileges when an application, agent, or integration exposes this helper to lower-trust users, prompts, model output, or plugin/tool input.

The PoV is deterministic and local-only. It installs only the npm package, runs harmless marker commands, and does not contact any live service after installation.

References

  • github.com/MervinPraison/PraisonAI/security/advisories/GHSA-5jv7-2mjm-h6qj
  • github.com/advisories/GHSA-5jv7-2mjm-h6qj
  • nvd.nist.gov/vuln/detail/CVE-2026-57133

Code Behaviors & Features

Detect and mitigate GHSA-5jv7-2mjm-h6qj with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 1.5.1 before 1.7.2

Fixed versions

  • 1.7.2

Solution

Upgrade to version 1.7.2 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-693: Protection Mechanism Failure
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
  • CWE-863: Incorrect Authorization

Source file

npm/praisonai/GHSA-5jv7-2mjm-h6qj.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:09 +0000.