[Bug]: Windows auto mode with sandbox off allows inline Office COM Quit() to close the user's PowerPoint
QwenPaw Version
2.1.0 (governance behavior present since the 2.0.1 unsandboxed shell fallback)
Description
On Windows, with approval level auto and the security sandbox turned off, an agent-authored inline Office COM shell command is executed instead of denied. PowerPoint.Application, Excel.Application, Word.Application, and Outlook.Application are single-instance COM servers. Quit() on that object terminates the user's already-open app, not a private automation instance.
Built-in slide-render scripts that avoid Application.Quit() do not cover this path. The command is not in the repo; the model emits it during self-checks, and the shell tool runs it.
Unmatched shell commands are classified as SANDBOX_FALLBACK in GovernancePolicy.evaluate. When the sandbox is disabled or unavailable, ResourceGovernor rewrites that decision to ALLOW (running unsandboxed). dangerous_shell_commands.yaml has no signature for inline Office COM, so nothing flags the command before that rewrite.
Related PR(s): none
Security considerations: Local impact only. A shell command the agent is already allowed to run can close the user's Office process. No remote code execution or credential exposure.
Component(s) Affected
- Core / Backend (app, agents, config, providers, utils, local_models)
- Console (frontend web UI)
- Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- Skills
- CLI
- Documentation (website)
- Tests
- CI/CD
- Scripts / Deploy
Environment
- QwenPaw version: 2.1.0
- OS: Windows
- Install method: from source / desktop package
- Python version (if applicable): 3.12
Steps to Reproduce
- Windows, with Microsoft PowerPoint already open on a user file.
- Set tool approval to
autoand turn the security sandbox off. - Ask the agent to run a PowerShell Office COM self-check, for example
New-Object -ComObject PowerPoint.Applicationfollowed byQuit(). The same happens for Excel, Word, Outlook, and a one-liner such aswin32com.client.Dispatch("PowerPoint.Application").Quit().
Actual vs Expected
- Actual: The command matches no detection rule, becomes
SANDBOX_FALLBACK, thenALLOWbecause the sandbox is off. PowerShell attaches to the running PowerPoint COM server andQuit()closes the user's PowerPoint. - Expected: Inline Office COM automation is denied before the unsandboxed fallback, including when the sandbox is off. The user's PowerPoint, Excel, Word, and Outlook stay open. Ordinary shell commands such as
echo helloremain allowed.
Logs / Screenshots
ResourceGovernor: sandbox disabled by config, running 'Bash' unsandboxed (ALLOW)Relevant code:
src/qwenpaw/governance/policy.py: unmatched shell returnsGovernanceAction.SANDBOX_FALLBACKsrc/qwenpaw/governance/resource_governor.py: if the sandbox is not usable, that decision is replaced withGovernanceAction.ALLOWsrc/qwenpaw/security/tool_guard/rules/dangerous_shell_commands.yaml: no Office COM rule
Additional Notes
Suggested fix: add a CRITICAL shell detection rule for inline Office COM construction (New-Object -ComObject / GetActiveObject / CreateObject / win32com Dispatch against PowerPoint.Application, Excel.Application, Word.Application, Outlook.Application, and the same Quit() pattern). CRITICAL findings are denied in Phase 1, so they never reach the sandbox-off ALLOW path.
Please do not treat in-process product scripts that only Close() a private temp presentation as the bug. Those scripts never call Application.Quit() on an attached user instance. The hole is agent-improvised shell COM plus the unsandboxed fallback.
Source: agentscope-ai/QwenPaw