CVE-2026-55530: praisonaiagents: ast_grep_rewrite rewrites arbitrary files without the @require_approval gate enforced on every sibling mutation tool
Tools in praisonaiagents/tools/ that modify on-disk state or run code are uniformly wrapped with @require_approval, which routes the call through an interactive approval flow before the body runs and fails closed — on denial (or with no approval backend configured) it raises PermissionError and the side effect does not occur. This is applied at every sibling mutation entry point:
| File | Line | Symbol | Risk level |
|---|---|---|---|
file_tools.py | 212 | copy_file | high |
file_tools.py | 239 | move_file | high |
file_tools.py | 266 | delete_file | high |
edit_tools.py | 38 | EditTools.edit_file | high |
edit_tools.py | 155 | edit_file | high |
shell_tools.py | 32 | execute_command | critical |
python_tools.py | 352 | execute_code | critical |
ast_grep_tool.py:149 ast_grep_rewrite is structurally a sibling of these but has no decorator and no from ..approval import require_approval import. With dry_run=False (LLM-controllable), it builds sg --pattern <P> --rewrite <R> --lang <L> --update-all <path> (lines 204–211) and calls subprocess.run(cmd, ...) (line 215), modifying every file under path matching the pattern. There is no approval gate, no _validate_path workspace check, and no cwd= sandboxing. The function is registered as a top-level tool (__init__.py:182) and exposed via the code_intelligence built-in profile (profiles.py).
A secondary defect: on the dry_run=False path ast_grep_rewrite returns the literal string No changes made to the caller even when it modified files (the “No changes made” return at ast_grep_tool.py:230 is reached on this path), so an operator inspecting tool output sees no record that a write occurred.
References
Code Behaviors & Features
Detect and mitigate CVE-2026-55530 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 →