T09 · Insecure Skill Coding Practices
- Location
SKILL.md:104- Finding
Unverified Recipient Selection May Disclose Files to the Wrong Contact
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 104-108 and 128-132
Vulnerability Type: Unverified UI target selection and unsafe automatic transmission
Risk Level: MediumVulnerable Code
powershell # Step 4: Select first result and enter chat [System.Windows.Forms.SendKeys]::SendWait("{UP}") Start-Sleep 0.5 [System.Windows.Forms.SendKeys]::SendWait("{ENTER}") Start-Sleep 1powershell # Step 6: Paste and send [System.Windows.Forms.SendKeys]::SendWait("^v") Start-Sleep 1 [System.Windows.Forms.SendKeys]::SendWait("{ENTER}") Write-Host "[OK] File sent to: $contactName"Technical Analysis
The documented PowerShell automation selects the first WeChat search result using keyboard events but never reads the selected result or verifies that its identity exactly matches
contactName. It subsequently pastes and sends the file with another unconditional keyboard event.Reliance on global
SendKeysevents and fixed delays also creates focus and timing races. Search-result ordering, similar contact names, UI latency, unexpected dialogs, or focus changes can cause the operations to target a different conversation or control. The success message is based on the supplied contact name rather than verification of the active conversation or actual recipient.The PowerShell code is embedded in
SKILL.md; the referencedscripts/send-file.ps1file is absent from the audited package. Therefore, the current JavaScript entry point fails its existence check before this behavior can execute. The vulnerability applies if the documented script is materialized or otherwise used as instructed.Attack Path
- A user invokes the skill with an existing absolute file path and an intended contact name.
- WeChat returns multiple or similarly named contacts, or another contact appears first in the result ordering.
- The automation presses Up and Enter without determining which result i ...[truncated 764 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace global keyboard navigation with Windows UI Automation queries that identify search results and conversation headers through stable automation properties.
- Normalize and compare the selected result's complete display name against
contactName; reject partial, ambiguous, or duplicate matches. - Verify the active conversation header immediately before pasting and again before sending.
- Require explicit user confirmation that displays both the resolved recipient and canonical file path before transmission.
- Fail closed if focus cannot be confirmed, multiple matches exist, UI elements are unavailable, or any operation times out.
- Check the return value of focus-related Win32 operations and confirm that the WeChat window remains foreground.
- Avoid fixed sleeps as the sole synchronization mechanism; wait for specific UI state transitions with bounded timeouts.
- Report success only after obtaining evidence from the UI that the intended conversation received the file.
- Include the reviewed PowerShell file in the package so the executable implementation matches the documented and audited source.
