Categories
CVE-2026-40153

Vulnerability in praisonaiagents (CVE-2026-40153)

Summary

Vulnerability in praisonaiagents (CVE-2026-40153). Confidential information can be exposed externally. Exploitable via execute_command. Mitigation: upgrade to 1.5.128 or later.

Original description

The description as published by the source.

Summary

The execute_command function in shell_tools.py calls os.path.expandvars() on every command argument at line 64, manually re-implementing shell-level environment variable expansion despite using shell=False (line 88) for security. This allows exfiltration of secrets stored in environment variables (database credentials, API keys, cloud access keys). The approval system displays the unexpanded $VAR references to human reviewers, creating a deceptive approval where the displayed command differs from what actually executes.

Details

The vulnerable code is in src/praisonai-agents/praisonaiagents/tools/shell_tools.py:

# Line 60: command is split
command = shlex.split(command)

# Lines 62-64: VULNERABLE — expands ALL env vars in every argument
# Expand tilde and environment variables in command arguments
# (shell=False means the shell won't do this for us)
command = [os.path.expanduser(os.path.expandvars(arg)) for arg in command]

# Line 88: shell=False is supposed to prevent shell feature access
process = subprocess.Popen(
    command,
    ...
    shell=False,  # Always use shell=False for security
)

The security problem is a disconnect between the approval display and actual execution:

  1. The LLM generates a tool call: execute_command(command="cat $DATABASE_URL")
  2. _check_tool_approval_sync in tool_execution.py:558 passes {"command": "cat $DATABASE_URL"} to the approval backend
  3. ConsoleBackend (backends.py:81-85) displa…

Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-40153 has been found in praisonaiagents.
Attackers can target a specific entry point like execute_command over the network to misuse the product.
Confidential information can be exposed externally.
What to do: upgrade praisonaiagents to 1.5.128 or later.
If unsure, ask your IT team or search "praisonaiagents CVE-2026-40153" on the vendor's site.

CVE-2026-40153 (praisonaiagents) — CWE-526
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: execute_command / shell_tools.py / _check_tool_approval_sync / ConsoleBackend
Patched: 1.5.128 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

A vulnerability (CWE-526) exists in praisonaiagents. Attackers reach the vulnerable code path via execute_command without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of praisonaiagents. Attack surface: execute_command / shell_tools.py / _check_tool_approval_sync / ConsoleBackend.

🔥 Severity

Severity: ?. Confidential information can be exposed externally.

🔧 How to fix

Update to 1.5.128.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'praisonaiagents' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'praisonaiagents' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で praisonaiagents を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade praisonaiagents to 1.5.128

    ステージング環境で 1.5.128 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

PyPI praisonaiagents
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.5.128"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details