Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. praisonai
  4. ›
  5. GHSA-h2w2-v7j6-xqm4

GHSA-h2w2-v7j6-xqm4: npm PraisonAI AgentLoop onToolCall approval runs after tool execution

June 18, 2026

The published npm package praisonai exports createAgentLoop(), whose onToolCall callback is documented and exampled as an approval hook. The implementation calls PraisonAI’s generateText() wrapper with the caller’s executable tools first, receives toolResults, and only then calls onToolCall().

Because AI SDK generateText() executes tools with an execute function as part of the generation call, onToolCall can deny a tool only after the sensitive side effect has already happened. PraisonAI then returns finishReason: "tool_rejected", which is a false security signal: the rejected tool already ran.

The PoV is deterministic and local-only. It uses mock AI SDK modules, no live model call, no API key, and no network target. The tool increments an in-memory counter rather than touching the filesystem or executing commands.

References

  • github.com/MervinPraison/PraisonAI/security/advisories/GHSA-h2w2-v7j6-xqm4
  • github.com/advisories/GHSA-h2w2-v7j6-xqm4

Code Behaviors & Features

Detect and mitigate GHSA-h2w2-v7j6-xqm4 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 1.4.0 before 1.7.2

Fixed versions

  • 1.7.2

Solution

Upgrade to version 1.7.2 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-693: Protection Mechanism Failure
  • CWE-862: Missing Authorization
  • CWE-863: Incorrect Authorization

Source file

npm/praisonai/GHSA-h2w2-v7j6-xqm4.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:23:18 +0000.