T09 · Insecure Skill Coding Practices
- Location
server.py:55- Finding
Sensitive WeChat Screenshots Persisted at Predictable Paths
- Content
View full analysis
Vulnerability Details
File Location:
server.py:55-57,server.py:97-99, andserver.py:117-119
Vulnerability Type: Predictable plaintext storage of sensitive screenshots
Risk Level: MediumVulnerable Code:
python img = capture_window() if img: img.save(str(Path(__file__).parent / "verify.png"))python input_bbox = (win_left, win_bottom - 80, win_right, win_bottom - 20) input_img = ImageGrab.grab(bbox=input_bbox) input_img.save(str(Path(__file__).parent / "input_verify.png"))python img = capture_window() if img: img.save(str(Path(__file__).parent / "result.png"))Technical Analysis
The message workflow captures the WeChat window, message input area, and post-send result and writes those images into the project directory under fixed names. These screenshots may disclose private conversations, contact identities, message contents, and other visible desktop information.
The files are not deleted after use, encrypted, redacted, or created with explicitly restrictive permissions. Their predictable paths also make them straightforward for another local user or process with access to the directory to discover and read. Reusing the fixed names overwrites previous images but does not prevent exposure through backups, indexing services, filesystem snapshots, or concurrent access.
Writing runtime artifacts into the installed project directory can additionally cause availability failures when the package is installed in a read-only location.
Attack Path
- A user or MCP client invokes the message-sending operation.
- The application captures the active chat window and the input area.
- The images are saved as
verify.png,input_verify.png, andresult.pngbesideserver.py. - The files remain after the operation completes.
- A local user, process, indexing service, backup service, or later application with access to the project directory r ...[truncated 476 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not persist verification screenshots by default; perform any necessary validation in memory.
- Place diagnostic capture functionality behind an explicit, informed opt-in setting.
- If persistence is required, use a dedicated temporary directory rather than the package directory.
- Create files with unpredictable names and owner-only permissions.
- Redact chat content, contact names, notifications, and unrelated screen regions before storage.
- Delete temporary captures immediately after processing and implement cleanup for abnormal termination.
- Document what is captured, why it is needed, how long it is retained, and who can access it.
- Handle screenshot failures without interrupting or falsely reporting the message workflow.
