Repository navigation
[Security Audit] Multiple vulnerabilities identified: Sandbox Escape (RCE), hardcoded PostHog key, Phone Home and command injection !!! #6366
diablomike20
started this conversation in
General
Replies: 1 comment
|
the rce via unsanitized getattr with dunder access is a real class of bug, not theoretical. the fix is straightforward: explicitly filter any attribute name starting with |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
================================================================================
PRAISONAI SECURITY ADVISORIES & COMPREHENSIVE VULNERABILITY DOSSIER
Prepared for Maintainers & Responsible Issue Reporting
Date: November 14, 2026
Target Repository: https://github.com/MervinPraison/PraisonAI
This document contains exhaustive, technical deep-dive writeups for the four
major security vulnerabilities identified during a full source code audit of the
PraisonAI monorepo. Each section includes exact source code line citations,
runtime mechanics, threat modeling, verified exploit walkthroughs, and precise
patches.
================================================================================
ISSUE #1 (CRITICAL - CVSS 9.8):
Sandbox Escape & Remote Code Execution in job_workflow.py via Unsanitized getattr
TITLE:
[CRITICAL / RCE] Arbitrary Code Execution and Sandbox Escape in job_workflow.py via Unsanitized getattr and Missing Dunder Attribute Filtering
SEVERITY:
Critical (CVSS v3.1: 9.8 - AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
CWE-94: Improper Control of Generation of Code ('Code Injection')
CWE-265: Privilege / Sandbox Escape
AFFECTED COMPONENT:
src/praisonai-code/praisonai_code/cli/features/job_workflow.pyLines 310–385 (specifically
_eval_condition, line 376)DETAILED TECHNICAL DESCRIPTION:
In
job_workflow.py, the_eval_condition()method is intended to evaluatedynamic condition expressions in workflows safely. The developer attempted to
implement sandbox isolation using two mechanisms:
_ALLOWED_NODES) allowing nodes likeast.Expression,ast.Compare,ast.Name,ast.Constant,ast.Call,ast.Attribute, andast.Assign._SAFE_BUILTINS) that strips dangerousbuiltins like
eval,exec,open, and__import__.THE FATAL FLAWS:
_SAFE_BUILTINSexplicitly passes through Python's standardgetattrfunction unmodified (
"getattr": getattr).underscores (
_) or dunder names (e.g.__class__,__base__,__subclasses__,__init__,__globals__).ast.Call,ast.Attribute, andast.Assignare all permitted, anycondition expression can traverse Python's object inheritance graph at runtime
to reach restricted modules directly from in-memory objects.
VERIFIED EXPLOIT WALKTHROUGH (Proof of Concept):
The vulnerability was experimentally verified. By starting with a benign literal
like an empty tuple
(), an attacker or an untrusted workflow payload traversesthe object tree:
Because AST validation reports
Validation passed: True, this payload executesunimpeded, allowing full takeover of the host operating system.
CONTRAST WITH SIBLING MODULE:
In the same repository,
src/praisonai-code/praisonai_code/cli/features/hybrid_workflow.py(line 358) handles this correctly: it implements a custom AST tree-walker that
strictly checks:
if node.attr.startswith('_'): raise AttributeError(...)and avoids native
eval()altogether.RECOMMENDED REMEDIATION:
Option A (Immediate Hotfix): Wrap
getattrwith a strict dunder sanitizer:Option B (Architectural Fix - Recommended):
Replace the
eval()approach injob_workflow.pywith the safe AST interpreteralready established in
hybrid_workflow.py.================================================================================
ISSUE #2 (HIGH - CVSS 7.5):
Hardcoded Production PostHog API Key & Centralized Telemetry in telemetry.py
TITLE:
[HIGH / Credential Exposure] Hardcoded Production PostHog Project API Key in telemetry.py and Test Suites
SEVERITY:
High (CVSS v3.1: 7.5 - AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N)
CWE-798: Use of Hard-coded Credentials
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
AFFECTED FILES:
src/praisonai-agents/praisonaiagents/telemetry/telemetry.py(Line 225)src/praisonai-agents/telemetry_analysis.md(Line 33)src/praisonai-agents/test_posthog_detailed.py(Line 24)src/praisonai-agents/test_posthog_error.py(Line 11)src/praisonai-agents/test_posthog_import.py(Line 17)src/praisonai-agents/tests/test_posthog_fixed.py(Line 23)EXACT CODE SNIPPET:
In
src/praisonai-agents/praisonaiagents/telemetry/telemetry.py(lines 222–230):WHAT IT DOES IN REALITY:
(
phc_skZpl3eFLQJ4iYjsERNMbCO6jfeSJi2vyZlPahKgxZ7) pointing to the Europeancloud cluster (
https://eu.i.posthog.com).SDK asynchronously dispatches analytics payloads containing:
agent_executions),task_completions),tool_calls) and internal exception counts.WHY IT IS DANGEROUS:
a private or local environment unknowingly transmit host metadata and usage
metrics to a third-party European cloud dashboard.
any third party can write arbitrary spam events to the author's PostHog project,
corrupting their product analytics or exhausting their monthly PostHog event quota.
RECOMMENDED REMEDIATION:
telemetry.py. Telemetry must strictly requirethe user to supply their own key via environment variables:
phc_mock_test_key_0000000000000000000000000).================================================================================
ISSUE #3 (HIGH - CVSS 8.8):
Insecure Command Execution via shell=True in Bot Scheduler & Condition Gates
TITLE:
[HIGH / Command Injection] Insecure Subprocess Execution with shell=True in condition_gate.py and executor.py
SEVERITY:
High (CVSS v3.1: 8.8 - AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
AFFECTED FILES:
src/praisonai-bot/praisonai_bot/scheduler/condition_gate.py(Lines 207–214)src/praisonai-bot/praisonai_bot/scheduler/executor.py(Lines 1060–1068)src/praisonai-code/praisonai_code/cli/features/custom_definitions.py(Line 810)EXACT CODE SNIPPETS:
In
src/praisonai-bot/praisonai_bot/scheduler/condition_gate.py(line 207):In
src/praisonai-bot/praisonai_bot/scheduler/executor.py(line 1060):Where
commandis extracted directly from the job spec mapping:WHAT IT DOES IN REALITY:
When
subprocess.Popenis invoked withshell=True, Python delegates commandparsing entirely to the system shell interpreter:
cmd.exe /c "..."/bin/sh -c "..."Because the
commandargument is passed as a raw string rather than a tokenizedlist of discrete arguments, the shell processes shell metacharacters such as:
&,&&,|,||,;,>,<,`, or$().THREAT MODEL & EXPLOITATION SCENARIO:
The
condition_gate.pymodule evaluates periodic change-detection jobs (e.g.,monitoring a git repo or running health checks). If a job definition is derived
from or influenced by:
An attacker can craft a payload appending arbitrary shell commands:
Under
shell=True,cmd.exeexecutesgit status, followed immediately by theinjected secondary command, yielding full unauthenticated remote command execution
under the user's active desktop/server session.
RECOMMENDED REMEDIATION:
shell=Falseacross all execution paths. Tokenize command stringsusing
shlex.split:through the AST command syntax filter already developed in
src/praisonai-agents/praisonaiagents/tools/shell_tools.py(_find_shell_syntax),which proactively rejects unquoted command operators (
&,|,;).================================================================================
ISSUE #4 (MEDIUM - CVSS 5.3):
Rust AgentOS Default Phoning-Home & Token Usage Leakage
TITLE:
[MEDIUM / Privacy & Configuration] Rust AgentOS Defaults to telemetry=true and Transmits Heartbeats and Token Usage to External Host
SEVERITY:
Medium (CVSS v3.1: 5.3 - AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N)
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
AFFECTED FILE:
src/praisonai-rust/praisonai/src/protocols/mod.rs(Lines 260–270, 300–340)EXACT CODE SNIPPET:
And in the protocol implementation (lines 306–316):
Where
AgentMetricscontains:WHAT IT DOES IN REALITY:
praisonai-rust).AgentOSConfigsetstelemetry: trueand targetshttps://agentos.praison.ai.AgentOSConfig::default():register),heartbeat),report_metrics),get_config).WHY IT IS DANGEROUS:
activity unless explicitly configured. In air-gapped, financial, or confidential
deployments, this causes unexpected egress violations.
https://agentos.praison.aiexperiences DNShijacking, BGP rerouting, or compromise, the
get_config()endpoint could deliverpoisoned configurations altering local agent behavior.
RECOMMENDED REMEDIATION:
telemetry: falseinDefault:.with_telemetry(true)or sets the environment variablePRAISONAI_TELEMETRY=1.http://127.0.0.1:0rather than a livecloud domain.
================================================================================
END OF SECURITY DOSSIER
All reactions