PRAISONAI · CVE-2026-39890 · AI agents & MCP
FIX → 4.5.115
PraisonAI loads agent definition files with a YAML parser that does not block dangerous tags such as !!js/function, so a crafted file is evaluated as code when it is loaded. An attacker who can upload an agent definition can run arbitrary commands on the server.
first public Apr 7, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Teams that run PraisonAI and let agent definition files come from users or other untrusted sources are exposed, since loading such a file can execute code on the server. Installations that only load agent files written by the team itself, with no upload path, are much less exposed. The advisory's code references (js-yaml, src/agents/agent.service.ts) do not match the PyPI package, so confirm which code path is actually vulnerable before deciding urgency.
Not affected if no-untrusted-agent-upload
Who cares ai-agents, praisonai, python, self-hosted
pip show praisonai and compare the version with 4.5.115; anything at or below 4.5.114 is affected.Upgrade to 4.5.115
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.
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.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
praisonai 4.5.115An attacker can create a malicious agent YAML file with the following content:
!!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.
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.
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:
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.
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.