{"id":"CVE-2026-39890","kind":"vulnerability","aliases":["CVE-2026-39890","GHSA-32vr-5gcf-3pw2"],"related":[],"title":"PraisonAI Vulnerable to Remote Code Execution via YAML Deserialization in Agent Definition Loading","description":"## Summary\nThe `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.\n\n## Details\nThe 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.\n\nThe vulnerable code is located in `src/agents/agent.service.ts` at line 55.\n\n## PoC\nAn attacker can create a malicious agent YAML file with the following content:\n```yaml\n!!js/function >\n  function(){ require('child_process').execSync('touch /tmp/pwned') }\n```\nThen, 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.\n\n## Impact\nThis 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.\n\n## Recommended Fix\nReplace 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:\n\n```typescript\nimport yaml from 'js-yaml';\nimport { JSON_SCHEMA } from 'js-yaml';\n\n// In the loadAgentFromFile method\nconst agent = yaml.load(fileContent, { schema: JSON_SCHEMA });\n```\n\nAlternatively, 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.\n\nAdditionally, 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.","summary":"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.","severity":"critical","cvss":9.8,"epss":0.00589,"exploited":false,"exploited_at":null,"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"],"how_to_check":"- Run `pip show praisonai` and compare the version with `4.5.115`; anything at or below `4.5.114` is affected.\n- 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`","status":"open","published_at":"2026-04-08T19:17:11+00:00","first_seen_at":"2026-11-16T15:42:56+00:00","triaged_at":"2026-11-16T15:44:06+00:00","updated_at":"2026-11-16T16:08:50+00:00","category":"ai-tooling","confidence":0.5,"triage":{"at":"2026-11-16T15:44:06Z","model":"claude-haiku-5-5","output":{"fix":"- `praisonai` `4.5.115`","reach":"unknown","title":"PraisonAI: unsafe YAML loading lets uploaded agent files run code","impact":"high","summary":"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.","audience":"developers","category":"ai-tooling","nicknames":[],"who_cares":["praisonai","python","ai-agents","self-hosted"],"confidence":0.5,"fix_status":"available","needs_auth":"unknown","worst_case":"Code runs on the server with the agent process's privileges","analyst_note":"Sources conflict: product data lists pypi:praisonai, but the advisory describes js-yaml in src/agents/agent.service.ts. Confirm the vulnerable codebase and the upload exposure at https://github.com/advisories/GHSA-32vr-5gcf-3pw2.","how_to_check":"- Run `pip show praisonai` and compare the version with `4.5.115`; anything at or below `4.5.114` is affected.\n- Find where agent definition files are loaded (AgentService.loadAgentFromFile) and check whether any upload or API path lets untrusted users supply them.\n- unknown for the exact file path in the advisory; the description refers to src/agents/agent.service.ts and js-yaml, which does not match a Python package.","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["no-untrusted-agent-upload"],"who_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.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"unknown","severity_if_unknown":"unknown"},"cost_usd":0.001401,"input_tokens":5487,"output_tokens":1704,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2026':15A,23A '-39890':16A,24A '-502':35B '/tmp/pwned':246C,285C '32vr':19A '3pw2':21A '55':223C '5gcf':20A 'abil':309C 'access':458C 'addit':427C 'agent':11A,30B,43B,77B,136C,231C,253C,264C,312C,385C,439C 'agentservice.loadagentfromfile':88C,261C 'ai':29B,32B 'ai-ag':28B 'ai-tool':31B 'allow':110C,293C 'altern':346C,391C 'api':141C,257C,273C,299C 'applic':394C 'arbitrari':81B,123C,211C,287C,316C 'attack':72B,112C,127C,226C,296C,306C 'authent':305C 'avoid':420C 'block':53B 'call':274C 'child':242C 'code':5A,66B,125C,146C,212C,216C,288C,317C,426C 'command':82B,283C 'complet':325C 'compromis':326C 'consid':402C,449C 'const':384C 'contain':199C 'content':237C 'control':459C 'craft':61B,114C 'creat':228C 'cve':14A,22A 'cwe':34B 'danger':54B,102C,192C 'data':330C 'default':180C,361C 'definit':12A,44B,78B,137C,254C,313C,440C 'demonstr':286C 'deprec':415C 'deseri':9A,159C 'detail':152C 'disabl':101C 'e.g':176C 'either':267C 'enabl':184C 'endpoint':142C,258C,300C 'ensur':437C 'especi':434C 'evalu':64B,208C 'exampl':365C 'execsync':244C 'execut':6A,122C,147C,213C,281C,289C,315C,425C 'exist':155C 'exploit':129C 'featur':401C 'file':45B,62B,99C,118C,138C,198C,233C,250C,435C,441C 'filecont':387C 'fix':337C 'follow':236C 'function':168C,189C,206C,240C 'ghsa':18A 'ghsa-32vr-5gcf-3pw2':17A 'host':40B 'impact':290C 'import':367C,373C 'input':433C 'javascript':124C,188C 'js':93C,163C,371C,378C 'js-yaml':92C,162C,370C,377C 'js/function':58B,106C,201C,239C 'js/undefined':108C 'json':177C,358C,374C,389C 'key':417C 'lead':143C,209C,323C 'librari':95C,165C 'line':222C 'load':13A,42B,70B,167C,266C,277C,341C,350C,421C 'loadagentfromfil':382C 'locat':218C,455C 'malici':116C,135C,196C,230C 'method':89C,342C,351C,383C,406C 'network':334C 'note':412C 'older':409C 'pars':97C,121C,186C,204C 'parser':49B 'payload':279C 'penetr':335C 'poc':224C 'praison':26A 'praisonai':1A,25A,27A,36B,41B 'process':160C,243C 'proper':457C 'python':37B 'rce':148C 'recommend':336C 'remot':4A,145C 'replac':338C 'requir':241C,395C 'run':80B 'safe':174C,181C,345C,354C,362C 'safeload':405C 'sanit':430C 'schema':175C,178C,182C,355C,359C,363C,375C,388C,390C 'secur':454C 'self':39B 'self-host':38B 'server':85B,151C,320C,329C 'specif':347C 'specifi':172C 'src/agents/agent.service.ts':220C 'startup':269C 'store':450C 'subset':398C 'summari':86C 'tag':55B,103C,202C,422C 'theft':331C 'though':411C 'tool':33B 'touch':245C,284C 'trigger':276C 'trust':446C 'type':193C 'typescript':366C 'unauthent':295C 'unprotect':302C 'unsaf':340C 'upload':75B,133C,248C,311C,436C,444C 'use':90C,170C,260C,348C,403C 'user':432C,447C 'valid':428C 'version':410C 'via':7A,139C,255C,271C 'vulner':2A,131C,154C,215C,292C 'without':100C,171C 'yaml':8A,48B,94C,98C,117C,158C,164C,197C,232C,238C,368C,372C,379C,400C 'yaml.load':386C","nicknames":[],"mitigations":[],"who_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.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["praisonai","praisonpraisonai"],"ptokens":["praison","praisonai"],"labels":["aiagents","aitooling","critical","cwe502","praisonai","pypi","python","selfhosted","vendor"],"campaign_type":null,"search_a":"'-2026':15A,23A '-39890':16A,24A '32vr':19A '3pw2':21A '5gcf':20A 'agent':11A 'code':5A 'cve':14A,22A 'definit':12A 'deseri':9A 'execut':6A 'ghsa':18A 'ghsa-32vr-5gcf-3pw2':17A 'load':13A 'praison':26A 'praisonai':1A,25A,27A 'remot':4A 'via':7A 'vulner':2A 'yaml':8A","search_b":"'-502':35B 'agent':30B,43B,77B 'ai':29B,32B 'ai-ag':28B 'ai-tool':31B 'arbitrari':81B 'attack':72B 'block':53B 'code':66B 'command':82B 'craft':61B 'cwe':34B 'danger':54B 'definit':44B,78B 'evalu':64B 'file':45B,62B 'host':40B 'js/function':58B 'load':42B,70B 'parser':49B 'praisonai':36B,41B 'python':37B 'run':80B 'self':39B 'self-host':38B 'server':85B 'tag':55B 'tool':33B 'upload':75B 'yaml':48B","search_c":"'/tmp/pwned':246C,285C '55':223C 'abil':309C 'access':458C 'addit':427C 'agent':136C,231C,253C,264C,312C,385C,439C 'agentservice.loadagentfromfile':88C,261C 'allow':110C,293C 'altern':346C,391C 'api':141C,257C,273C,299C 'applic':394C 'arbitrari':123C,211C,287C,316C 'attack':112C,127C,226C,296C,306C 'authent':305C 'avoid':420C 'call':274C 'child':242C 'code':125C,146C,212C,216C,288C,317C,426C 'command':283C 'complet':325C 'compromis':326C 'consid':402C,449C 'const':384C 'contain':199C 'content':237C 'control':459C 'craft':114C 'creat':228C 'danger':102C,192C 'data':330C 'default':180C,361C 'definit':137C,254C,313C,440C 'demonstr':286C 'deprec':415C 'deseri':159C 'detail':152C 'disabl':101C 'e.g':176C 'either':267C 'enabl':184C 'endpoint':142C,258C,300C 'ensur':437C 'especi':434C 'evalu':208C 'exampl':365C 'execsync':244C 'execut':122C,147C,213C,281C,289C,315C,425C 'exist':155C 'exploit':129C 'featur':401C 'file':99C,118C,138C,198C,233C,250C,435C,441C 'filecont':387C 'fix':337C 'follow':236C 'function':168C,189C,206C,240C 'impact':290C 'import':367C,373C 'input':433C 'javascript':124C,188C 'js':93C,163C,371C,378C 'js-yaml':92C,162C,370C,377C 'js/function':106C,201C,239C 'js/undefined':108C 'json':177C,358C,374C,389C 'key':417C 'lead':143C,209C,323C 'librari':95C,165C 'line':222C 'load':167C,266C,277C,341C,350C,421C 'loadagentfromfil':382C 'locat':218C,455C 'malici':116C,135C,196C,230C 'method':89C,342C,351C,383C,406C 'network':334C 'note':412C 'older':409C 'pars':97C,121C,186C,204C 'payload':279C 'penetr':335C 'poc':224C 'process':160C,243C 'proper':457C 'rce':148C 'recommend':336C 'remot':145C 'replac':338C 'requir':241C,395C 'safe':174C,181C,345C,354C,362C 'safeload':405C 'sanit':430C 'schema':175C,178C,182C,355C,359C,363C,375C,388C,390C 'secur':454C 'server':151C,320C,329C 'specif':347C 'specifi':172C 'src/agents/agent.service.ts':220C 'startup':269C 'store':450C 'subset':398C 'summari':86C 'tag':103C,202C,422C 'theft':331C 'though':411C 'touch':245C,284C 'trigger':276C 'trust':446C 'type':193C 'typescript':366C 'unauthent':295C 'unprotect':302C 'unsaf':340C 'upload':133C,248C,311C,436C,444C 'use':90C,170C,260C,348C,403C 'user':432C,447C 'valid':428C 'version':410C 'via':139C,255C,271C 'vulner':131C,154C,215C,292C 'without':100C,171C 'yaml':94C,98C,117C,158C,164C,197C,232C,238C,368C,372C,379C,400C 'yaml.load':386C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-04-07T20:48:22+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-32vr-5gcf-3pw2","url":"https://github.com/advisories/GHSA-32vr-5gcf-3pw2","severity":"critical","published_at":"2026-04-08T19:17:11+00:00","modified_at":"2026-11-16T15:41:34+00:00","first_seen_at":"2026-11-16T15:42:56+00:00","fetched_at":"2026-11-16T15:46:58+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-39890","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-39890","severity":null,"published_at":"2026-04-08T21:17:01+00:00","modified_at":"2026-07-24T21:10:00+00:00","first_seen_at":"2026-11-16T16:08:50+00:00","fetched_at":"2026-11-16T16:08:50+00:00","note":null}],"documents":[{"id":170710,"url":"https://api.github.com/repos/MervinPraison/PraisonAI/security-advisories/GHSA-32vr-5gcf-3pw2","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":170711,"url":"https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-32vr-5gcf-3pw2","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":"2026-04-07T20:48:22+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":170712,"url":"https://github.com/MervinPraison/PraisonAI/releases/tag/v4.5.115","title":"Release: github.com","kind":"release","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release: github.com"}],"disclosures":[],"exploit_sources":[{"type":"epss","score":0.00589,"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-39890"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}