---
id: "CVE-2026-39890"
page: "https://infrastack.ai/live/CVE-2026-39890"
kind: "vulnerability"
aliases: ["CVE-2026-39890", "GHSA-32vr-5gcf-3pw2"]
title: "PraisonAI Vulnerable to Remote Code Execution via YAML Deserialization in Agent Definition Loading"
severity: "critical"
cvss: 9.8
epss: 0.00589
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "praisonai", "fixed": ["4.5.115"], "affected": "<= 4.5.114", "ecosystem": "pypi"}, {"name": "praison praisonai", "fixed": [], "affected": "<= 4.5.114", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["ai-agents", "ai-tooling", "cwe-502", "praisonai", "python", "self-hosted"]
not_affected_if: ["no-untrusted-agent-upload"]
published_at: "2026-04-08T19:17:11+00:00"
first_seen_at: "2026-11-16T15:42:56+00:00"
updated_at: "2026-11-16T16:08:50+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-32vr-5gcf-3pw2", "first_seen_at": "2026-11-16T15:42:56+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-39890", "first_seen_at": "2026-11-16T16:08:50+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.00589, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-39890"}]
---

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

Link for people: https://infrastack.ai/live/CVE-2026-39890 (this .md is for agents)

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.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:praisonai affected <= 4.5.114 fixed 4.5.115
- vendor:praison praisonai affected <= 4.5.114 fixed no fixed version listed

## How to check

- Run `pip show praisonai` and compare the version with `4.5.115`; anything at or below `4.5.114` is affected.
- Find where agent definition files are loaded (AgentService.loadAgentFromFile) and check whether any upload or API path lets untrusted users supply them.

## Fix

- `praisonai` `4.5.115`

## Timeline

- 2026-11-16T15:42:56+00:00 ghsa https://github.com/advisories/GHSA-32vr-5gcf-3pw2
- 2026-11-16T16:08:50+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-39890

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/MervinPraison/PraisonAI/security-advisories/GHSA-32vr-5gcf-3pw2
- [advisory] Maintainer's advisory: github.com https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-32vr-5gcf-3pw2
- [fix] Release: github.com https://github.com/MervinPraison/PraisonAI/releases/tag/v4.5.115

## From the sources

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

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
