Skip to content
CVE-2026-62176

PraisonAI Deploy API Server Code Injection via f-string Interpolation (CVE-2026-62176)

Initial Access Execution Last updated:

Detects exploitation of CVE-2026-62176, a CWE-94 code injection vulnerability in PraisonAI (versions <= 4.6.77, fixed in 4.6.78). The deploy/api.py module generates Python server code by interpolating the agents_file parameter directly into an f-string, which is then written to a file and executed via subprocess.Popen. An attacker who controls the agents_file value through a CLI argument, configuration, or upstream API can break out of the string context and inject arbitrary Python, achieving code execution when the deploy command runs. The same pattern exists in deploy/docker.py. Detection focuses on PraisonAI deploy invocations, writes of generated server source files containing injected payloads, and anomalous child processes spawned by the Python server process.

Vulnerability Intelligence

Public PoC

Affected Software

Vendor
pip
Product
PraisonAI
Versions
<= 4.6.77

Weakness (CWE)

Timeline

Disclosed
October 7, 2026

CVSS

9.1
Critical (9.0–10)

What is CVE-2026-62176 PraisonAI Deploy API Server Code Injection via f-string Interpolation (CVE-2026-62176)?

PraisonAI Deploy API Server Code Injection via f-string Interpolation (CVE-2026-62176) (CVE-2026-62176) maps to the Initial Access and Execution tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for PraisonAI Deploy API Server Code Injection via f-string Interpolation (CVE-2026-62176), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint. The queries below are rated critical severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Execution
Microsoft Sentinel / Defender
kusto
// df00tech DF00-7488fa6bd1 · https://df00tech.com/detections/CVE-2026-62176 · licence: https://df00tech.com/detections/licence
let suspiciousTokens = dynamic(["__import__","os.system","subprocess","eval(","exec(","\")+","';import","\");","popen","/bin/sh","/bin/bash"]);
union
(
DeviceProcessEvents
| where (ProcessCommandLine has "praisonai" and ProcessCommandLine has_any ("deploy","api","serve"))
   or (FileName in~ ("python","python3","python.exe") and ProcessCommandLine has_any ("PraisonAI","praisonai") and ProcessCommandLine has "deploy")
| extend Signal = "praisonai_deploy_invocation"
),
(
DeviceFileEvents
| where FileName endswith ".py"
| where FolderPath has_any ("praisonai","PraisonAI","deploy")
| extend Signal = "generated_server_write"
)
| project Timestamp, DeviceName, AccountName, ActionType, FileName, FolderPath, InitiatingProcessFileName, ProcessCommandLine, Signal
| union (
DeviceProcessEvents
| where InitiatingProcessFileName in~ ("python","python3","uvicorn","python.exe")
| where InitiatingProcessCommandLine has_any ("praisonai","uvicorn","api.py")
| where FileName in~ ("sh","bash","cmd.exe","powershell.exe","curl","wget","nc","ncat") or ProcessCommandLine has_any (suspiciousTokens)
| extend Signal = "suspicious_child_of_deployed_server"
| project Timestamp, DeviceName, AccountName, ActionType="ProcessCreated", FileName, FolderPath, InitiatingProcessFileName, ProcessCommandLine, Signal
)
| sort by Timestamp desc

Correlates PraisonAI deploy invocations, writes of generated Python server source files, and suspicious child processes spawned by the generated uvicorn/Python server that indicate injected code execution.

critical severity medium confidence

Data Sources

Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents DeviceFileEvents

False Positives

  • Legitimate developers running `praisonai deploy` to generate and launch an API server during normal application deployment.
  • Generated server files that legitimately reference `subprocess` or `os` as part of configured agent tools.
  • CI/CD pipelines that build and smoke-test a PraisonAI deployment, spawning python child processes.

Query fingerprint DF00-7488fa6bd1 · licence

Sigma logsource & community rules

The detection logic for PraisonAI Deploy API Server Code Injection via f-string Interpolation (CVE-2026-62176) (CVE-2026-62176) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Simulate f-string injection payload in generated server file

    Expected signal: Process creation for python3 executing the generated file; file write of /tmp/praisonai_api.py; child process of python3 running id/os.system.

  2. Test 2 PraisonAI deploy invocation with crafted agents_file value

    Expected signal: Command line referencing praisonai deploy with embedded __import__/os.system tokens.

  3. Test 3 Suspicious shell child of uvicorn server (Windows)

    Expected signal: ProcessCreate event for cmd.exe with a parent chain including powershell/python and command line containing injection tokens.


Response Playbook

Triage

  1. Confirm the installed PraisonAI version on the host (`pip show praisonai`); versions <= 4.6.77 are vulnerable to CVE-2026-62176.
  2. Identify the source of the agents_file value used in the deploy command and determine whether it originated from untrusted input.
  3. Inspect the generated server source file for Python that breaks out of f-string literals, such as `__import__`, `os.system`, `subprocess`, or appended statements after a closing quote.
  4. Review process lineage: check whether the python/uvicorn server process spawned shells or network utilities shortly after generation.

Containment

  1. Stop the deployed PraisonAI API server process (uvicorn/python) and prevent it from auto-restarting.
  2. Quarantine or delete the attacker-controlled generated server source file and block regeneration until the input source is sanitized.
  3. Isolate the affected host from the network if suspicious child processes or outbound connections were observed.

Evidence Collection

  1. Preserve the generated server source file, the deploy command line, and the agents_file value that supplied the interpolated input.
  2. Collect process creation logs for the python/uvicorn parent and all child processes, including full command lines and timestamps.

Escalation Criteria

  • ! Escalate to incident response if the generated file contains executable payloads beyond expected server code or if the server process spawned shells, downloaders, or reverse-shell commands.
  • ! Escalate if the agents_file input was sourced from an untrusted or externally controllable channel, indicating active exploitation rather than a benign deploy.

Investigation Guide

Forensic Artifacts

  • > The deploy-generated Python server source file and its modification timestamp.
  • > Shell history and process audit logs showing the `praisonai deploy` invocation and any child processes.
  • > The PraisonAI agents_file configuration supplying the interpolated input.

Tuning Guidance

Baseline legitimate `praisonai deploy` usage in your environment (known hosts, users, and expected agents_file values). Allowlist deploys where the agents_file input comes from trusted, validated configuration. Prioritize alerts where the generated server source or child processes contain shell/network-exec indicators, and suppress developer-sandbox hosts that routinely generate and test servers.


Hunting Queries

Surface all PraisonAI deploy invocations and writes of generated Python server files for retrospective review.

Hunting — KQL
kql
// df00tech DF00-7488fa6bd1 · https://df00tech.com/detections/CVE-2026-62176 · licence: https://df00tech.com/detections/licence
DeviceFileEvents | where FileName endswith ".py" and FolderPath has_any ("praisonai","deploy") | where InitiatingProcessCommandLine has "praisonai" | project Timestamp, DeviceName, FolderPath, InitiatingProcessCommandLine
Hunting — SPL
spl
``` df00tech DF00-7488fa6bd1 · https://df00tech.com/detections/CVE-2026-62176 · licence: https://df00tech.com/detections/licence ```
index=* (sourcetype=linux:process OR sourcetype=Sysmon) (CommandLine="*praisonai*" AND CommandLine="*deploy*") | table _time host user CommandLine

Atomic Red Team Tests

Test 1 Simulate f-string injection payload in generated server file
linux

Writes a Python file mimicking a PraisonAI deploy-generated server where an interpolated value broke out of the f-string and injected a benign system call.

Command

bash
printf 'import uvicorn\nAGENT_NAME = "x"); import os; os.system("id > /tmp/praisonai_poc.txt"); ("\n' > /tmp/praisonai_api.py && python3 /tmp/praisonai_api.py || true

Cleanup

bash
rm -f /tmp/praisonai_api.py /tmp/praisonai_poc.txt

Expected Telemetry

Process creation for python3 executing the generated file; file write of /tmp/praisonai_api.py; child process of python3 running id/os.system.

Expected Detection

The KQL/SPL/EQL rules fire on the generated server write and the suspicious child command of the python parent.

Test 2 PraisonAI deploy invocation with crafted agents_file value
linux

Runs a mock deploy command line containing an agents_file value with injection metacharacters to trigger invocation detection.

Command

bash
python3 -c "print('simulating praisonai deploy')" ; echo praisonai deploy --agents_file 'name"); __import__(\'os\').system(\'echo pwn\'); ("' > /tmp/praisonai_deploy_cmd.log

Cleanup

bash
rm -f /tmp/praisonai_deploy_cmd.log

Expected Telemetry

Command line referencing praisonai deploy with embedded __import__/os.system tokens.

Expected Detection

Deploy-invocation branch of the detections matches on the praisonai + deploy command line containing injection tokens.

Test 3 Suspicious shell child of uvicorn server (Windows)
windows

Launches a process that mimics a uvicorn-parented shell spawn resulting from injected code.

Command

powershell
powershell -NoProfile -Command "$env:_parent='uvicorn'; Start-Process cmd.exe -ArgumentList '/c echo subprocess os.system __import__ & whoami'"

Cleanup

powershell
Remove-Item -ErrorAction SilentlyContinue $env:TEMP\praisonai_poc.txt

Expected Telemetry

ProcessCreate event for cmd.exe with a parent chain including powershell/python and command line containing injection tokens.

Expected Detection

The suspicious-child branch of the KQL and CQL rules matches on injection tokens in the child command line.

Related Detections

Blog posts about this detection

Browse by tactic

Full ATT&CK matrix Search all detections