Skip to content
MediumVulnerability

GHSA-cfxv-8fw8-rwpv: praisonaiagents: ast_grep_rewrite rewrites arbitrary files without the @require_approval gate enforced on every sibling mutation tool

Published
Record updated
View JSON
Affected
  • praisonaiagents < 1.6.58
Fixed in
1.6.58
  • released June 13, 2026, 73 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.2%

Summary

The `ast_grep_rewrite` function in `praisonaiagents/tools/ast_grep_tool.py` lacks the `@require_approval` decorator that every sibling file-mutation and code-execution tool in `praisonaiagents/tools/` applies. With `dry_run=False`, an LLM-controllable call runs `sg ... --update-all` through `subprocess.run`, rewriting every file under `path` that matches the pattern, with no approval gate, no `_validate_path` workspace check, and no `cwd=` sandboxing. The function returns the string `No changes made` even when files were modified.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.