T09 · Insecure Skill Coding Practices
- Location
scripts/send.py:44- Finding
AppleScript Injection Through Unsanitized Recipient and File Path
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a coherent image-sending purpose, but it can automatically transmit local files through Messages and contains unsafe AppleScript construction that could be abused.
Review before installing. Only use this with explicit recipient and file confirmation, and avoid sending sensitive files. The author should validate image files, restrict or confirm paths and recipients, pass AppleScript values as arguments instead of interpolating them, and clean up staged copies after sending.
scripts/send.py:44AppleScript Injection Through Unsanitized Recipient and File Path
scripts/send.py:27Arbitrary Local File Disclosure Through Missing Image and Path Validation
The skill invokes shell commands and performs file-writing behavior but does not declare any tool scope such as permissions or allowed-tools. This creates a mismatch between what the skill can do and what reviewers or enforcement systems can constrain, increasing the risk of unauthorized command execution or unintended file modification.
The phrase 'automatically send' authorizes autonomous action that transmits user data through a messaging app without an explicit approval gate at send time. Because images are often sensitive, automatic dispatch increases the chance of accidental disclosure and makes prompt-injection or ambiguous requests more dangerous in this skill context.
### Send Image
When user requests to send an image, automatically send via iMessage to the phone.
### Manual Commands
The trigger 'When user requests to send an image, automatically send via iMessage to the phone' is broad and can activate on loosely phrased user requests without confirming the recipient, image path, or intent. In a messaging context, overly permissive activation can lead to accidental exfiltration of private images to the configured phone number.
The skill omits a clear warning that using it will transmit an image to a phone number via iMessage and copy the file into ~/Pictures/openclaw-send/. Missing disclosure of these side effects undermines informed consent and may cause users to expose sensitive data or leave unintended local copies behind.
The code automatically assumes a China locale by prepending +86 to any 11-digit recipient number. This imposes a specific regional convention without offering the user a choice or documenting that the skill is intended only for a China-specific context.
The subprocess call itself is not using a shell, but it passes attacker-controlled data into an AppleScript string executed by osascript. Both recipient and send_path are interpolated without escaping, so crafted input containing AppleScript metacharacters such as quotes can break out of the intended string and inject arbitrary AppleScript commands, potentially triggering arbitrary local actions on the Mac through scriptable applications.
end tell
'''
result = subprocess.run(
['osascript', '-e', script],
capture_output=True,
text=True
No suspicious patterns detected.