Critical

PraisonAI Vulnerable to Remote Code Execution via YAML Deserialization in Agent Definition Loading

  • Disclosed: 08.04.2026
  • Updated: 11.10.2026 14:17

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:

ts
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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) praisonai < 4.5.115 4.5.115

References

CVSS score 9.8/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-502
Platform
Python (PyPI)
Package
praisonai
Disclosed
08.04.2026
Updated
11.10.2026 14:17

Sources and licenses

OSV / GitHub Advisory Database - GHSA-32vr-5gcf-3pw2 - CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2026-462 - PyPA Advisory Database; CC BY 4.0

Vulnerability history: praisonai

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (104) in the archive
Total entries
104
First → latest
04.2026 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 27
  • High 60
  • Medium 17

Disclosures per year

  1. 2026: 104
Severity:
  1. High · 7.5 CVE-2026-61439 < 4.6.78 4.6.78
  2. High · 7.3 CVE-2026-56839 < 4.6.59 4.6.59
  3. High · 7.2 CVE-2026-57114 >= 4.5.126, < 4.6.59 4.6.59
  4. Critical · 9.8 CVE-2026-57125 < 4.6.59 4.6.59
  5. High · 8.8 CVE-2026-57117 >= 4.6.10, < 4.6.59 4.6.59
  6. High · 7.8 CVE-2026-56838 >= 4.5.87, < 4.6.59 4.6.59
  7. High · 8.3 CVE-2026-56835 >= 3.11.0, < 4.6.59 4.6.59
  8. High · 8.2 CVE-2026-56836 >= 4.5.112, < 4.6.59 4.6.59
  9. High CVE-2026-47397 < 4.6.40 4.6.40
  10. Critical · 9.8 CVE-2026-41497 < 4.5.149 4.5.149
  11. Critical · 9.8 CVE-2026-40288 < 4.5.139 4.5.139
  12. High · 8.4 CVE-2026-40287 < 4.5.139 4.5.139
  13. Critical · 9.3 CVE-2026-40154 < 4.5.128 4.5.128
  14. Critical · 9.6 CVE-2026-40088 < 4.5.121 4.5.121
  15. High · 8.8 CVE-2026-39891 < 4.5.115 4.5.115
  16. PraisonAI Vulnerable to Remote Code Execution via YAML Deserialization in Agent Definition Loading this entry
    Critical · 9.8 CVE-2026-39890 < 4.5.115 4.5.115
  17. Critical CVE-2026-35615 < 1.5.113 1.5.113
Show more (7) Showing 80 of 87

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.