/

CVE-2026-57137

Severity:

HIGH RISK

(8.8)

Authorization Bypass (CWE-862) in PraisonAI Agent Loop

CVE-2026-57137

Deferred

Vulnerability type

Category:

Improper Authorization

CWE:

CWE-693, CWE-862, CWE-863

Impact:

Unauthorized Tool Execution and Data Modification

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A flaw in PraisonAI's agent loop allows executable tools to run before the configured approval callback can accept or reject them. Applications that rely on this callback as a human or policy authorization boundary may therefore execute denied file, command, API, or data-modifying operations.

Affected context

The issue occurs in PraisonAI multi-agent applications that use createAgentLoop() with executable tools and an onToolCall approval callback. It becomes risky when the callback is treated as the control that must authorize tool execution, but the underlying generation flow invokes tool handlers before consulting that decision. The affected code path was present in releases from 1.4.0 through 1.7.2.

Exploit preconditions

  • Attack surface: Agent-generated tool calls handled by the PraisonAI TypeScript agent loop
  • Required access: The ability to influence an agent's task, prompt, or tool-call decision within an application
  • Trigger point: Tool execution during text generation before the onToolCall approval result is enforced
  • Why exploitation is possible: Executable tools are passed to the generation process before authorization is applied, allowing a denied tool to produce side effects and populate tool results

Why this happens

The underlying bug is an authorization-ordering failure. The agent loop makes executable tools available to the generation engine before invoking the callback intended to approve or reject each tool call. As a result, the approval mechanism records a rejection after execution rather than preventing execution.

This maps primarily to CWE-862: Missing Authorization, with related characteristics of CWE-863: Incorrect Authorization and CWE-693: Protection Mechanism Failure. The insecure pattern is treating a post-execution callback as an effective authorization boundary.

Potential impact

  • Unauthorized file operations may occur
  • Shell or command execution may be triggered
  • External APIs could be called without approval
  • Application or business data may be modified or deleted
  • Sensitive information could be exposed through tool results
  • Agent workflows could be abused for broader actions permitted by the runtime identity

General mitigation guidance

Mitigation generally focuses on enforcing authorization before any executable tool handler can run.

Common defensive patterns include:

  • Place approval and policy evaluation before tool dispatch or generation-time execution
  • Expose only explicitly permitted tools to the generation engine for each request
  • Use deny-by-default authorization for file, command, network, and data-modifying operations
  • Separate tool selection from tool execution so policy checks cannot occur after side effects
  • Apply least-privilege identities, restricted filesystem access, and narrowly scoped API credentials
  • Treat callback outcomes as mandatory execution gates rather than audit events
  • Add transaction, sandboxing, or dry-run controls for operations with irreversible effects
  • Reduce trust in agent-generated arguments through schema validation and contextual policy checks

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis that identifies executable tools passed to generation APIs before approval checks
  • Code review searches for authorization callbacks invoked after dispatch, handler execution, or result creation
  • Tests asserting that rejected tool calls produce no side effects and no tool results
  • Policy checks requiring deny-by-default tool registries and pre-dispatch authorization
  • Runtime audit correlation between approval decisions and actual tool invocations
  • Automated review tools that flag callback-based controls positioned after side-effecting operations

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/commit/6b4b59fbe71a74983626c7a0cf7e10c47cd004f9
github.comgithub.com/MervinPraison/PraisonAI/releases/tag/v4.6.62
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-h2w2-v7j6-xqm4

Frequently asked

questions

Exploitability depends on the application's exposure. A remote user may be able to trigger the issue when they can influence agent tasks or prompts, while other deployments may require authenticated access to an agent interface.

No direct host access is necessarily required. The relevant prerequisite is the ability to cause an agent to request a tool operation in an application where the approval callback is relied upon as the authorization boundary.

Authorization and policy checks should complete before executable tools are exposed to or invoked by the generation engine. A rejected request should never reach a side-effecting handler.

Use deny-by-default tool policies, least-privilege runtime identities, pre-execution authorization tests, and integration tests that verify rejected operations have no side effects.

Find out what's already
exploitable in your codebase.