T09 · Insecure Skill Coding Practices
- Location
server.py:320- Finding
Unauthenticated Desktop-Control API with Permissive Cross-Origin Access
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill openly provides Windows screen capture and mouse/keyboard control, but its unauthenticated localhost API gives any local process desktop-control access, so it needs review before installation.
Install only on a trusted, single-user Windows session, avoid running it elevated, stop it when not actively needed, and assume any local process that can reach localhost:8767 may capture the screen or drive the mouse and keyboard. Review the unauthenticated API, wildcard CORS, unpinned dependencies, and WSL start-script behavior before use.
server.py:320Unauthenticated Desktop-Control API with Permissive Cross-Origin Access
start.sh:14Local API Spoofing Can Cause Agents to Trust Attacker-Controlled File Paths
start.sh:21PowerShell Command Injection Through Unvalidated Environment-Derived Path Components
SKILL.md:24Unpinned Third-Party Python Dependencies Create a Mutable Supply-Chain Risk
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
# Move cursor (no click)
curl -X POST http://localhost:8767/move -d '{"x": 500, "y": 300}'
# Click
curl -X POST http://localhost:8767/click -d '{"x": 500, "y": 300}'
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
$PWSH -Command "Get-Process python -ErrorAction SilentlyContinue | Where-Object {\$_.CommandLine -like '*wincontrol*'} | Stop-Process -Force" 2>/dev/null
# Clean up frames
rm -rf /tmp/wincontrol/*.jpg 2>/dev/null
# Verify stopped
if curl -s --max-time 1 http://localhost:8767/ping > /dev/null 2>&1; then
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
$PWSH -Command "Get-Process python -ErrorAction SilentlyContinue | Where-Object {\$_.CommandLine -like '*wincontrol*'} | Stop-Process -Force" 2>/dev/null
# Clean up frames
rm -rf /tmp/wincontrol/*.jpg 2>/dev/null
# Verify stopped
if curl -s --max-time 1 http://localhost:8767/ping > /dev/null 2>&1; then
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
$PWSH -Command "Get-Process python -ErrorAction SilentlyContinue | Where-Object {\$_.CommandLine -like '*wincontrol*'} | Stop-Process -Force" 2>/dev/null
# Clean up frames
rm -rf /tmp/wincontrol/*.jpg 2>/dev/null
# Verify stopped
if curl -s --max-time 1 http://localhost:8767/ping > /dev/null 2>&1; then
This markdown file describes AI remote control, screenshot capture, mouse control, and keyboard control, all of which can affect user privacy and system integrity. Under the markdown-specific SQP-2 criteria, the description should include a warning or disclosure about these behaviors, but the listed entries only describe features and endpoints.
The README advertises remote screenshot capture and mouse/keyboard control over HTTP but does not warn users about the serious privacy and system-integrity risks of exposing such capabilities. In the context of an AI agent skill, these features enable surveillance and full interactive control of a desktop, which materially increases the chance of misuse, unsafe deployment, or accidental exposure beyond localhost.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
python server.py
# Test
curl http://localhost:8767/ping
# Capture with custom quality
curl -X POST http://localhost:8767/capture -H "Content-Type: application/json" -d '{"quality": 60}'
The skill exposes sensitive capabilities—local HTTP control of mouse, keyboard, and screenshot capture—yet the manifest declares no explicit tool scope or permissions boundary. This increases the chance that the skill is installed or invoked without operators understanding that it enables shell/network-assisted desktop control.
The skill advertises screenshot capture and local file storage without a strong privacy warning that screenshots may include credentials, personal data, messages, documents, and other sensitive on-screen information. Even if bound to localhost, captured images may still be read by local processes or mishandled by users and downstream tooling.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Health check
curl http://localhost:8767/ping
# Output: {"ok": true}
# Capture a screenshot
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
Returns: `{"ok": true, "path": ".../screenshot.jpg", "quality": 90}`
Each capture overwrites `screenshot.jpg` in the skill directory. The file is automatically deleted when the server stops.
**Optional quality override:**
```bash
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
Returns: `{"ok": true, "path": ".../screenshot.jpg", "quality": 90}`
Each capture overwrites `screenshot.jpg` in the skill directory. The file is automatically deleted when the server stops.
**Optional quality override:**
```bash
The documentation provides direct examples for clicking, dragging, scrolling, and keyboard entry, including launching applications, but does not clearly warn that remote input can trigger destructive actions such as file deletion, command execution, privilege changes, or unintended submissions. For a desktop-control skill, omission of this warning materially raises misuse risk because these endpoints are inherently high impact.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Move cursor (no click)
curl -X POST http://localhost:8767/move -d '{"x": 500, "y": 300}'
# Click
curl -X POST http://localhost:8767/click -d '{"x": 500, "y": 300}'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Click somewhere
curl -X POST http://localhost:8767/click -d '{"x": 500, "y": 300}'
sleep 0.5
# Capture to see result
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### Troubleshooting
**Issue**: Server starts but curl fails
- Check if port 8767 is in use: `lsof -i :8767`
- Kill existing process: `kill <PID>`
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
return r.json().get("path")
def click(x, y):
requests.post(f"{API}/click", json={"x": x, "y": y})
def enter(keys):
requests.post(f"{API}/enter", json={"keys": keys})
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
requests.post(f"{API}/click", json={"x": x, "y": y})
def enter(keys):
requests.post(f"{API}/enter", json={"keys": keys})
# Example workflow
if __name__ == "__main__":
The /capture endpoint captures the current desktop and writes a screenshot to disk without any authentication, authorization, consent flow, or user-visible warning. Screenshots can expose passwords, tokens, emails, chats, documents, or other sensitive on-screen data, and the skill context explicitly enables remote desktop observation, which makes accidental or unauthorized collection especially dangerous.
The HTTP API exposes mouse movement, clicks, drags, scrolling, and keyboard entry to any local process able to reach localhost:8767, with no authentication, authorization, CSRF protection, or user confirmation. In this skill's context, these endpoints provide full interactive control of the Windows desktop, enabling arbitrary command execution through GUI automation, destructive actions, data exfiltration, and stealthy abuse of an already logged-in session.
The manifest explicitly advertises screenshot capture and remote mouse/keyboard control over HTTP, which are highly sensitive capabilities with clear privacy and system-integrity implications. Presenting these functions without any warning, consent language, authentication expectations, or safety constraints increases the risk of covert surveillance, unauthorized input injection, and destructive system actions, especially because the skill is designed for desktop remote control.
This code performs safety-relevant actions: it force-kills processes at L08 and recursively deletes files at L11. While it prints a generic stopping message, it does not clearly disclose that it will forcibly terminate processes or remove JPG files from /tmp/wincontrol, and there is no confirmation prompt or explanatory comment aimed at the user.