T09 · Insecure Skill Coding Practices
- Location
scripts/run.py:194- Finding
Arbitrary Local File Upload Due to Missing Media Validation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does what it claims by uploading media to memories.ai, but it can transmit any readable local file path plus time/location metadata without media validation or a final confirmation step.
Review before installing. Only use this skill with specific media files you intend to upload to memories.ai, and be aware it may transmit the file contents, filename, timestamp, coordinates, and API key-authenticated request to the service. Avoid invoking it on broad or ambiguous file requests, and prefer adding media-type validation and an explicit confirmation step before upload.
scripts/run.py:194Arbitrary Local File Upload Due to Missing Media Validation
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
url = f"https://nominatim.openstreetmap.org/search?{params}"
req = urllib.request.Request(url, headers={"User-Agent": "luci-upload-skill/1.0"})
try:
with urllib.request.urlopen(req, timeout=10) as resp:
results = json.loads(resp.read())
if results:
return float(results[0]["lat"]), float(results[0]["lon"])
The script reads a secret API key from the environment or .env and sends it in an Authorization header to an external service, while also uploading the local media file and associated time/location metadata. This is expected functionality, but it is still a real security/privacy-sensitive operation because compromise of the destination service, misconfiguration, or accidental use could disclose sensitive media, location history, and credentials.
})
try:
with urllib.request.urlopen(req, timeout=300) as resp:
return json.loads(resp.read())
except urllib.error.HTTPError as e:
error_body = e.read().decode() if e.fp else ""
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
UPLOAD_PATH = "/serve/luci/api/manual/upload"
USERINFO_API = API_HOST + "/serve/api/userinfo"
ENV_FILE = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), ".env")
def _load_env():
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def _load_env():
"""Load MEMORIES_AI_KEY from .env file next to the skill root."""
if not os.path.exists(ENV_FILE):
return None
with open(ENV_FILE) as f:
The skill uses shell execution, reads environment secrets, and sends data over the network, but it does not declare any explicit tool scope or permissions boundaries. That increases the chance an agent invokes it with broader capabilities than intended, making secret exposure, unintended file access, or external transmission harder to govern and audit.
The invocation text includes broad triggers like 'upload media,' 'add a video/photo to their memory,' or 'send a file to Luci,' which could cause the agent to select this skill in ambiguous situations. In a skill that exfiltrates local files and metadata to an external service, loose routing language raises the risk of unintended uploads without sufficiently specific user intent.
The skill describes uploading photos/videos plus capture time and location metadata to memories.ai, but it does not prominently warn that sensitive media and embedded metadata will be transmitted to a third-party service. Because media can contain highly sensitive personal content and location history, lack of explicit notice and consent handling materially increases privacy and data-leak risk.
The skill is explicitly designed to upload local media and infer or attach capture time and GPS/location data, but it does not present an explicit privacy warning or consent gate before doing so. In this context, that omission is meaningful because media plus temporal and geolocation metadata can reveal highly sensitive personal information beyond the file contents alone.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"""
info = {"creation_time": None, "latitude": None, "longitude": None}
try:
result = subprocess.run(
["ffprobe", "-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", filepath],
capture_output=True, text=True, timeout=15,
)