Back to skill

Security audit

Screen Icon Finder

Security checks for vulnerabilities and agentic risk

Overview

This skill is an icon-finding helper, but it can capture the full screen, leave screenshots on disk, and guide GUI clicks without clear safeguards.

Install only if you are comfortable with the agent taking full-screen screenshots and potentially clicking the active desktop. Use it on non-sensitive screens, provide an explicit input screenshot when possible, review the annotated result before any click, and delete _temp_screen.png and _result.png after use.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/find_icon.py:8
Finding

Predictable Temporary and Output Files Permit Symlink-Based File Clobbering

Content
View full analysis

Vulnerability Details

File Location: scripts/find_icon.py:8-12, scripts/find_icon.py:23-24, and scripts/find_icon.py:128-131
Vulnerability Type: Unsafe temporary files and predictable output paths
Risk Level: Medium

Vulnerable Code

python
def screenshot(path='_temp_screen.png'):
    """Capture the full screen and save it."""
    img = pyautogui.screenshot()
    img.save(path)
    return path
python
if big_path is None:
    big_path = screenshot()
python
if results:
    big_path = '_temp_screen.png' if big is None else big
    mark_icons(results, big_path, '_result.png')
    print(f'Annotated image saved: _result.png')

The final write is performed by mark_icons:

python
def mark_icons(results, big_path, output_path, color=(0, 255, 0)):
    """Mark all matching positions on the image with sequence numbers."""
    img = cv2.imread(big_path)
    font = cv2.FONT_HERSHEY_SIMPLEX

    for i, r in enumerate(results):
        x, y, score, cx, cy, scale, w, h = r
        cv2.rectangle(img, (x, y), (x + w, y + h), color, 3)
        cv2.putText(img, f'{i+1}', (x + w // 2 - 10, y - 10), font, 1.5, (0, 0, 255), 3)
        cv2.putText(img, f'{score:.2f}', (x + w // 2 - 20, y + h + 25), font, 0.6, color, 1)

    cv2.imwrite(output_path, img)

Technical Analysis

The script stores automatically captured screenshots in _temp_screen.png and annotated results in _result.png. Both are fixed relative paths resolved against the process's current working directory. The script does not create these files atomically, verify ownership, reject symbolic links, or prevent replacement of existing files.

If an attacker can write to the working directory, the attacker can create either predictable filename as a symbolic link to another file writable by the user running the Skill. Calls to img.save() or cv2.imwrite() can then follow that link and over ...[truncated 1852 chars]

Remediation
View remediation

Remediation Suggestions

  1. Use Python's tempfile facilities for screenshots rather than a fixed relative filename:

    python
    import os
    import tempfile
    
    def screenshot():
        fd, path = tempfile.mkstemp(prefix='screen-icon-', suffix='.png')
        os.close(fd)
        img = pyautogui.screenshot()
        img.save(path)
        return path
    
  2. Prefer a private TemporaryDirectory with permissions restricted to the current user, and remove temporary screenshots in a finally block after processing.

  3. Generate result files in a trusted output directory using randomized names. If a stable destination must be supported, require it as an explicit user parameter rather than silently overwriting _result.png.

  4. Refuse unintended overwrites. Where supported, open output files using exclusive creation semantics such as os.open with O_CREAT | O_EXCL, and write through the securely opened file descriptor.

  5. Do not rely only on os.path.islink() followed by a separate write, because that introduces a race condition. Use descriptor-based, atomic filesystem operations and platform-appropriate no-follow protections such as O_NOFOLLOW where available.

  6. Validate that output paths reside beneath an approved directory and document the lifecycle and sensitivity of captured screenshots.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script takes a full-screen screenshot automatically when no input image is provided, which grants broader access to on-screen data than a narrowly scoped icon-matching utility needs. This can expose unrelated sensitive information visible on the desktop, such as messages, credentials, or personal data, especially if the screenshot is stored on disk as '_temp_screen.png'.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation expands the skill from passive image analysis into active GUI control by recommending pyautogui.click on discovered coordinates. That increases the capability from observation to action, enabling unintended or unsafe interactions with the user's system without any built-in guardrails, confirmation flow, or implementation constraints.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill claims it supports clicking icons, but the provided code only locates and marks them. This capability mismatch is dangerous because downstream agents or users may assume safe, supported click behavior exists and improvise ad hoc automation around unverified coordinates, increasing the chance of misclicks or unintended actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation instructs clicking matched icons without requiring explicit warning, confirmation, or human verification. Because template matching can produce false positives or ambiguous matches, automatic clicking could trigger destructive actions such as sending messages, approving prompts, or deleting data in the active UI.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code saves screenshots and later annotated images to predictable local files, which can leave sensitive visual data on disk after the task completes. These files may be accessible to other local users, backup systems, or later processes, creating unintended persistence of potentially confidential screen contents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The function automatically captures a full-screen screenshot when no input image is provided, which can collect sensitive on-screen data such as messages, credentials, or internal documents without an explicit user warning or confirmation. In the context of a GUI automation skill that can also locate and click icons, implicit screen capture increases privacy risk because users may not realize local screen contents are being collected as part of the action.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest description and usage examples are entirely in Chinese and instruct the interaction flow in that language, without offering an alternative language or stating that the skill is region-specific. This can be a language/locale policy issue when a skill implicitly forces one language without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.