CVE-2026-39308: PraisonAI Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-r9x3-wx45-2v7f
CVSS 7.1
CWE-22
Published
Advisory Summary

CVE-2026-39308 is a HIGH (CVSS 7.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting PraisonAI libraries in the PyPI ecosystem. The issue involves praisonai recipe registry publish path traversal allows out-of-root file write. Remediation is available by upgrading affected packages to version 4.5.113.

CVE-2026-39308 at a Glance

CVE Identifier CVE-2026-39308
GHSA Identifier GHSA-r9x3-wx45-2v7f
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product PraisonAI
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2026-39308

To remediate this vulnerability, upgrade all affected PraisonAI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

PraisonAI fixed: 4.5.113
pip install PraisonAI>=4.5.113
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show PraisonAI

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-39308, inspect your installed packages using pip:

pip show PraisonAI

Analyze the terminal output to locate any version of PraisonAI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.5.113), your application is affected.

Note: The pip show PraisonAI command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In PraisonAI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary PraisonAI's recipe registry publish endpoint writes uploaded recipe bundles to a filesystem path derived from the bundle's internal `manifest.json` before it verifies that the manifest `name` and `version` match the HTTP route. A malicious publisher can place `../` traversal sequences in the bundle manifest and cause the registry server to create files outside the configured registry root even though the request is ultimately rejected with HTTP `400`. This is an arbitrary file write / path traversal issue on the registry host. It affects deployments that expose the recipe registry publish flow. If the registry is intentionally run without a token, any network client that can reach the service can trigger it. If a token is configured, any user with publish access can still exploit it. ### Details The bug is caused by the order of operations between the HTTP handler and the registry storage layer. 1. `RegistryServer._handle_publish()` in `src/praisonai/praisonai/recipe/server.py:370-426` parses `POST /v1/recipes/{name}/{version}`, writes the uploaded `.praison` file to a temporary path, and immediately calls: ```python result = self.registry.publish(tmp_path, force=force) ``` 2. `LocalRegistry.publish()` in `src/praisonai/praisonai/recipe/registry.py:214-287` opens the uploaded tarball, reads `manifest.json`, and trusts the attacker-controlled `name` and `version` fields: ```python name = manifest.get("name") version = manifest.get("version") recipe_dir = self.recipes_path / name / version recipe_dir.mkdir(parents=True, exist_ok=True) bundle_name = f"{name}-{version}.praison" dest_path = recipe_dir / bundle_name shutil.copy2(bundle_path, dest_path) ``` 3. Validation helpers already exist in the same file: ```python def _validate_name(name: str) -> bool: def _validate_version(version: str) -> bool: ``` but they are not called before the filesystem write. 4. Only after `publish()` returns does the route compare the manifest values with the URL values: ```python if result["name"] != name or result["version"] != version: self.registry.delete(result["name"], result["version"]) return self._error_response(...) ``` At that point the out-of-root artifact has already been created. The request returns an error, but the write outside the registry root remains on disk. Verified vulnerable behavior: - Request path: `/v1/recipes/safe/1.0.0` - Internal manifest name: `../../outside-dir` - Server response: HTTP `400` - Leftover artifact: `/tmp/praisonai-publish-traversal-poc/outside-dir-1.0.0.praison` This demonstrates that the write occurs before the consistency check and rollback. ### PoC Run the single verification script from the checked-out repository: ```bash cd "/Users/r1zzg0d/Documents/CVE hunting/targets/PraisonAI" python3 tmp/pocs/poc.py ``` Expected vulnerable output: ```text [+] Publish response status: 400 { "ok": false, "error": "Bundle name/version (../../outside-dir@1.0.0) doesn't match URL (safe@1.0.0)", "code": "error" } [+] Leftover artifact exists: True [+] Artifact under registry root: False [+] RESULT: VULNERABLE - upload was rejected, but an out-of-root artifact was still created. ``` Then verify the artifact manually: ```bash ls -l /tmp/praisonai-publish-traversal-poc/outside-dir-1.0.0.praison find /tmp/praisonai-publish-traversal-poc -maxdepth 2 | sort ``` What the script does internally: 1. Starts a local PraisonAI recipe registry server. 2. Builds a malicious `.praison` bundle whose internal `manifest.json` contains `name = ../../outside-dir`. 3. Uploads that bundle to the apparently safe route `/v1/recipes/safe/1.0.0`. 4. Receives the expected `400` mismatch error. 5. Confirms that `outside-dir-1.0.0.praison` was still written outside the configured registry directory. ### Impact This is a path traversal / arbitrary file write vulnerability in the recipe registry publish flow. Impacted parties: - Registry operators running the PraisonAI recipe registry service. - Any deployment that allows remote recipe publication. - Any environment where adjacent writable filesystem locations contain sensitive application data, service files, or staged content that could be overwritten or planted. Security impact: - Integrity impact is high because an attacker can create or overwrite files outside the registry root. - Availability impact is possible if the attacker targets adjacent runtime or application files. - The issue can be chained with other local loading or deployment behaviors if nearby files are later consumed by another component. ### Remediation 1. Validate `manifest.json` `name` and `version` before any path join or filesystem write. Reject path separators, `..`, absolute paths, and any value that fails the existing `_validate_name()` / `_validate_version()` checks. 2. Resolve the final destination path and enforce that it remains under the configured registry root before calling `mkdir()` or `copy2()`. For example, compare the resolved destination against `self.recipes_path.resolve()`. 3. Move the URL-to-manifest consistency check ahead of `self.registry.publish(...)`, or refactor `publish()` so it receives already-validated route parameters instead of trusting attacker-controlled manifest values for storage paths.

CVE-2026-39308 Affected PraisonAI Versions

1 component(s)
Fixed Versions:
4.5.113
Product / Package Ecosystem Affected Versions Fixed Version
PraisonAI
PyPI
< 4.5.113
4.5.113

References

Frequently Asked Questions

What is CVE-2026-39308?
CVE-2026-39308 is a security vulnerability in PraisonAI involving PraisonAI recipe registry publish path traversal allows out-of-root file write under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which PraisonAI versions are affected?
Affected versions include releases prior to 4.5.113 across affected packages: PraisonAI.
What version fixes CVE-2026-39308?
Upgrading to 4.5.113 (or the latest patched release for your respective branch) resolves the vulnerability.
Is PraisonAI affected?
Yes, PraisonAI is affected in releases prior to 4.5.113. Upgrade your dependency to 4.5.113 or later.
What is the CVSS score of CVE-2026-39308?
CVE-2026-39308 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L.
What CWE is associated with CVE-2026-39308?
CVE-2026-39308 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2026-39308?
Run the dependency tree command: 'pip show PraisonAI'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r9x3-wx45-2v7f",
  "modified" : "2026-04-07T22:10:12Z",
  "published" : "2026-04-06T23:09:19Z",
  "aliases" : [ "CVE-2026-39308" ],
  "summary" : "PraisonAI recipe registry publish path traversal allows out-of-root file write",
  "details" : "### Summary\n\nPraisonAI's recipe registry publish endpoint writes uploaded recipe bundles to a filesystem path derived from the bundle's internal `manifest.json` before it verifies that the manifest `name` and `version` match the HTTP route. A malicious publisher can place `../` traversal sequences in the bundle manifest and cause the registry server to create files outside the configured registry root even though the request is ultimately rejected with HTTP `400`.\n\nThis is an arbitrary file write / path traversal issue on the registry host. It affects deployments that expose the recipe registry publish flow. If the registry is intentionally run without a token, any network client that can reach the service can trigger it. If a token is configured, any user with publish access can still exploit it.\n\n### Details\n\nThe bug is caused by the order of operations between the HTTP handler and the registry storage layer.\n\n1. `RegistryServer._handle_publish()` in `src/praisonai/praisonai/recipe/server.py:370-426` parses `POST /v1/recipes/{name}/{version}`, writes the uploaded `.praison` file to a temporary path, and immediately calls:\n\n```python\nresult = self.registry.publish(tmp_path, force=force)\n```\n\n2. `LocalRegistry.publish()` in `src/praisonai/praisonai/recipe/registry.py:214-287` opens the uploaded tarball, reads `manifest.json`, and trusts the attacker-controlled `name` and `version` fields:\n\n```python\nname = manifest.get(\"name\")\nversion = manifest.get(\"version\")\nrecipe_dir = self.recipes_path / name / version\nrecipe_dir.mkdir(parents=True, exist_ok=True)\nbundle_name = f\"{name}-{version}.praison\"\ndest_path = recipe_dir / bundle_name\nshutil.copy2(bundle_path, dest_path)\n```\n\n3. Validation helpers already exist in the same file:\n\n```python\ndef _validate_name(name: str) -> bool:\ndef _validate_version(version: str) -> bool:\n```\n\nbut they are not called before the filesystem write.\n\n4. Only after `publish()` returns does the route compare the manifest values with the URL values:\n\n```python\nif result[\"name\"] != name or result[\"version\"] != version:\n    self.registry.delete(result[\"name\"], result[\"version\"])\n    return self._error_response(...)\n```\n\nAt that point the out-of-root artifact has already been created. The request returns an error, but the write outside the registry root remains on disk.\n\nVerified vulnerable behavior:\n\n- Request path: `/v1/recipes/safe/1.0.0`\n- Internal manifest name: `../../outside-dir`\n- Server response: HTTP `400`\n- Leftover artifact: `/tmp/praisonai-publish-traversal-poc/outside-dir-1.0.0.praison`\n\nThis demonstrates that the write occurs before the consistency check and rollback.\n\n### PoC\n\nRun the single verification script from the checked-out repository:\n\n```bash\ncd \"/Users/r1zzg0d/Documents/CVE hunting/targets/PraisonAI\"\npython3 tmp/pocs/poc.py\n```\n\nExpected vulnerable output:\n\n```text\n[+] Publish response status: 400\n{\n  \"ok\": false,\n  \"error\": \"Bundle name/version (../../outside-dir@1.0.0) doesn't match URL (safe@1.0.0)\",\n  \"code\": \"error\"\n}\n[+] Leftover artifact exists: True\n[+] Artifact under registry root: False\n[+] RESULT: VULNERABLE - upload was rejected, but an out-of-root artifact was still created.\n```\n\nThen verify the artifact manually:\n\n```bash\nls -l /tmp/praisonai-publish-traversal-poc/outside-dir-1.0.0.praison\nfind /tmp/praisonai-publish-traversal-poc -maxdepth 2 | sort\n```\n\nWhat the script does internally:\n\n1. Starts a local PraisonAI recipe registry server.\n2. Builds a malicious `.praison` bundle whose internal `manifest.json` contains `name = ../../outside-dir`.\n3. Uploads that bundle to the apparently safe route `/v1/recipes/safe/1.0.0`.\n4. Receives the expected `400` mismatch error.\n5. Confirms that `outside-dir-1.0.0.praison` was still written outside the configured registry directory.\n\n### Impact\n\nThis is a path traversal / arbitrary file write vulnerability in the recipe registry publish flow.\n\nImpacted parties:\n\n- Registry operators running the PraisonAI recipe registry service.\n- Any deployment that allows remote recipe publication.\n- Any environment where adjacent writable filesystem locations contain sensitive application data, service files, or staged content that could be overwritten or planted.\n\nSecurity impact:\n\n- Integrity impact is high because an attacker can create or overwrite files outside the registry root.\n- Availability impact is possible if the attacker targets adjacent runtime or application files.\n- The issue can be chained with other local loading or deployment behaviors if nearby files are later consumed by another component.\n\n### Remediation\n\n1. Validate `manifest.json` `name` and `version` before any path join or filesystem write. Reject path separators, `..`, absolute paths, and any value that fails the existing `_validate_name()` / `_validate_version()` checks.\n\n2. Resolve the final destination path and enforce that it remains under the configured registry root before calling `mkdir()` or `copy2()`. For example, compare the resolved destination against `self.recipes_path.resolve()`.\n\n3. Move the URL-to-manifest consistency check ahead of `self.registry.publish(...)`, or refactor `publish()` so it receives already-validated route parameters instead of trusting attacker-controlled manifest values for storage paths.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "PraisonAI"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.113"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.5.112"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-r9x3-wx45-2v7f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39308"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MervinPraison/PraisonAI"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/releases/tag/v4.5.113"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-06T23:09:19Z",
    "nvd_published_at" : "2026-04-07T17:16:36Z"
  }
}