Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsStudyTraining
ProjectsChecklistsAI RankingsNewsletterStatusTagsAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Study
Training
Projects
Checklists
AI Rankings
Newsletter
Status
Tags
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

629+ Articles
118+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. Security
  3. CVE-2026-39890: PraisonAI YAML Injection Achieves Remote Code Execution
CVE-2026-39890: PraisonAI YAML Injection Achieves Remote Code Execution

Critical Security Alert

This vulnerability is actively being exploited. Immediate action is recommended.

SECURITYCRITICALCVE-2026-39890

CVE-2026-39890: PraisonAI YAML Injection Achieves Remote Code Execution

A critical code injection vulnerability in PraisonAI's AgentService allows attackers to craft malicious YAML files using dangerous js-yaml tags such as !!js/function to execute arbitrary code when agent configuration files are parsed. Fixed in version 4.5.115.

Dylan H.

Security Team

April 9, 2026
6 min read

Affected Products

  • PraisonAI (AgentService) < 4.5.115

Executive Summary

A critical code injection vulnerability (CVE-2026-39890, CVSS 9.8) has been discovered in the PraisonAI multi-agent AI framework. The flaw exists in the AgentService.loadAgentFromFile method, which uses the js-yaml library to parse YAML configuration files without disabling dangerous tags.

By crafting a malicious YAML file containing tags such as !!js/function or !!js/undefined, an attacker can cause arbitrary JavaScript code to execute when the file is parsed — achieving full remote code execution on the host running PraisonAI. The vulnerability is fixed in version 4.5.115.


Vulnerability Overview

AttributeValue
CVE IDCVE-2026-39890
CVSS Score9.8 (Critical)
CWECWE-94 — Improper Control of Code Generation (Code Injection)
TypeYAML Injection / Remote Code Execution
Attack VectorFile / Network (malicious YAML input)
Privileges RequiredNone (in applicable attack scenarios)
User InteractionNone (when processing attacker-supplied files)
Affected ComponentAgentService.loadAgentFromFile
Fixed Version4.5.115

Affected Versions

PackageAffected VersionsFixed Version
PraisonAI (AgentService)< 4.5.1154.5.115

Technical Analysis

Root Cause

The AgentService.loadAgentFromFile method loads agent configuration from YAML files to initialize PraisonAI agents. The method passes the YAML file content directly to js-yaml's load() function without specifying a safe schema.

The js-yaml library supports multiple schema types:

SchemaSafetySupports
DEFAULT_SAFE_SCHEMASafeStandard YAML types only
DEFAULT_FULL_SCHEMAUnsafeIncluding !!js/function, !!js/undefined, !!js/regexp

When load() is called without explicitly specifying DEFAULT_SAFE_SCHEMA (or using safeLoad() in older js-yaml versions), it defaults to DEFAULT_FULL_SCHEMA — which allows dangerous JavaScript-specific YAML tags that execute code during deserialization.

The Dangerous Tags

TagDescriptionImpact
!!js/functionEmbeds a JavaScript function as a YAML valueCode executed on parse
!!js/undefinedRepresents a JavaScript undefined valueRuntime manipulation
!!js/regexpEmbeds a JavaScript regular expressionReDoS potential

How the Attack Works

A malicious YAML file uses the !!js/function tag to embed a JavaScript function body in what appears to be a standard configuration field. When js-yaml parses the file under DEFAULT_FULL_SCHEMA, it instantiates and invokes the embedded function as part of the deserialization process — before any application-level validation can run.

The attack requires no special privileges or complex setup: the attacker simply provides a YAML file where a configuration field value is replaced with a !!js/function block containing their payload. The code runs with the full permissions of the PraisonAI process.

Attack Scenarios

Scenario 1: Malicious Configuration File An attacker uploads or provides a crafted agent YAML configuration file. When PraisonAI loads the file (e.g., from a web interface, API endpoint, or shared storage), the malicious function executes.

Scenario 2: Supply Chain / Repository Compromise A compromised repository or template library contains a malicious agent configuration YAML. Any PraisonAI installation that loads this template executes the attacker's code.

Scenario 3: API Endpoint Accepting YAML If PraisonAI exposes an endpoint accepting agent definitions in YAML format and that input is parsed with loadAgentFromFile, remote exploitation is possible with no local access required.


Impact Assessment

Impact AreaDescription
Arbitrary Code ExecutionExecute any Node.js/system code as the PraisonAI process user
Credential TheftAccess API keys, model credentials, database passwords from environment
Data ExfiltrationExfiltrate agent configurations, user data, model outputs
Lateral MovementUse compromised host to pivot into internal infrastructure
PersistenceInstall backdoors or modify agent configurations for ongoing access
Agent HijackingModify agent behavior to produce malicious outputs or leak data

Immediate Remediation

Step 1: Update PraisonAI to 4.5.115

# Update via pip
pip install --upgrade "praisonai>=4.5.115"
 
# Verify version
pip show praisonai | grep Version
 
# For Node.js / TypeScript installs
npm install praisonai@latest
npm show praisonai version

Step 2: Audit YAML Loading Code

If you have custom code that loads YAML with js-yaml, ensure you use the safe loading method:

// VULNERABLE - uses DEFAULT_FULL_SCHEMA
const yaml = require('js-yaml');
const config = yaml.load(fileContent);
 
// SAFE - uses DEFAULT_SAFE_SCHEMA
const config = yaml.load(fileContent, { schema: yaml.DEFAULT_SAFE_SCHEMA });
 
// ALSO SAFE (older js-yaml API)
const config = yaml.safeLoad(fileContent);
# In Python, use PyYAML's safe_load instead of load
import yaml
 
# VULNERABLE
config = yaml.load(file_content)
 
# SAFE
config = yaml.safe_load(file_content)

Step 3: Validate YAML Sources

# Implement schema validation before parsing
# Only accept agent YAML files from trusted, verified sources
 
# Restrict file upload endpoints to authenticated users only
# Validate YAML content against a strict schema before any parsing

Step 4: Audit for Compromise

# Check for suspicious processes spawned by PraisonAI
ps auxf | grep -A5 praisonai
 
# Review outbound network connections
ss -tulnp | grep -i node
ss -tulnp | grep -i python
 
# Search for recently modified files in PraisonAI directories
find /path/to/praisonai -newer /path/to/praisonai/package.json -type f 2>/dev/null
 
# Check for unauthorized agent configuration files with dangerous YAML tags
grep -r "js/function\|js/undefined\|js/regexp" --include="*.yaml" --include="*.yml" .

Detection Indicators

IndicatorDescription
YAML files containing !!js/functionExploit payload present
YAML files containing !!js/undefined or !!js/regexpSuspicious YAML tags
Node.js process spawning unexpected subprocessesActive exploitation
Unexpected outbound connections from PraisonAI processExfiltration in progress
New or modified agent configuration filesPossible persistence mechanism

Why YAML Deserialization Attacks Are High-Risk

YAML deserialization attacks are one of the most dangerous vulnerability classes because:

  1. Execution occurs at parse time — before any application logic validates the input
  2. No user interaction required — simply loading a file triggers the payload
  3. Wide attack surface — any application that processes user-supplied YAML files is potentially vulnerable
  4. Easy to exploit — exploit payloads are simple, well-documented, and widely known

This vulnerability class has affected many major frameworks and libraries over the years, including PyYAML, SnakeYAML (Java), and Ruby's Psych — making it a recurring and well-understood threat.


Post-Remediation Checklist

  1. Update PraisonAI to version 4.5.115 or later immediately
  2. Audit all YAML loading code to ensure DEFAULT_SAFE_SCHEMA or safeLoad() is used
  3. Validate YAML inputs against strict schemas before any deserialization
  4. Restrict who can provide agent configuration files — implement authentication and authorization
  5. Scan existing YAML files for !!js/function, !!js/undefined, and !!js/regexp tags
  6. Review process and network logs for evidence of prior exploitation
  7. Rotate credentials accessible to the PraisonAI process
  8. Subscribe to PraisonAI security advisories for future vulnerability notifications

References

  • NVD — CVE-2026-39890
  • PraisonAI GitHub Repository
  • PraisonAI Security Advisories
  • js-yaml — Safe Loading Documentation
  • OWASP — Deserialization of Untrusted Data
#CVE-2026-39890#PraisonAI#YAML Injection#Remote Code Execution#js-yaml#AI Security#Code Injection#Vulnerability

Related Articles

CVE-2026-39888: PraisonAI Sandbox Escape Enables Remote Code Execution

A critical sandbox escape vulnerability in PraisonAI's multi-agent framework allows attackers to bypass the Python code execution sandbox, defeating the AST-based blocklist and restricted __builtins__ protections in execute_code() to achieve arbitrary remote code execution. Fixed in version 1.5.115.

4 min read

CVE-2026-25776: Movable Type Critical Code Injection (CVSS 9.8)

Six Apart's Movable Type CMS contains a critical code injection vulnerability allowing unauthenticated attackers to execute arbitrary Perl scripts on affected servers, earning a maximum-severity CVSS score of 9.8.

5 min read

CVE-2021-4473: Tianxin Behavior Management System Unauthenticated Command Injection

A critical unauthenticated command injection vulnerability in the Tianxin Internet Behavior Management System's Reporter component allows attackers to execute arbitrary OS commands via a crafted objClass parameter. CVSS score: 9.8.

5 min read
Back to all Security Alerts