T09 · Insecure Skill Coding Practices
- Location
scripts/index.py:101- Finding
Unrestricted Local File Read and Upload to External Recognition API
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill broadly performs song recognition, but it can upload any readable file path to an external iFlytek API without validating that it is audio or limiting file size.
Review before installing. Use this only with audio files you intentionally want to send to iFlytek, avoid sensitive or private recordings, and do not let untrusted prompts or workflows choose the file path. A safer version should restrict inputs to an approved upload directory, reject symlinks and non-regular files, validate audio type, enforce a maximum size, and clearly disclose the external upload.
scripts/index.py:101Unrestricted Local File Read and Upload to External Recognition API
The documentation overstates or misrepresents behavior by claiming singing recognition and ACRCloud-based technology while the described invocation only accepts an audio file path and the implementation reportedly calls an iFlytek endpoint directly. Security-relevant behavior mismatches are dangerous because reviewers and users may approve or supply data based on false assumptions about what the skill does and which third party receives it.
The skill declares environment-variable and network-dependent behavior but does not define an explicit tool/permission scope. That weakens sandboxing and reviewability because users and platforms cannot clearly see that the skill will access credentials and make outbound requests to a third-party service.
The skill handles user audio and API credentials yet does not clearly warn that audio content will be transmitted over the network to a third-party recognition service. This is a privacy and trust issue because users may unknowingly upload sensitive or copyrighted audio, and operators may expose credentials without understanding the external data flow.
The skill reads a local audio file, base64-encodes its contents, and sends that data to a third-party cloud endpoint for recognition without any explicit user consent, privacy notice, or data-minimization control at the point of transmission. Audio can contain sensitive personal content, so silently exporting it off-host creates a real privacy and compliance risk even though remote processing is expected for this skill's functionality.
This code performs an outbound HTTP POST to an external API and includes the full audio payload in the request body. In the context of a song-recognition skill this network behavior is functionally necessary, but it is still a genuine data-exfiltration surface because local file contents leave the system and may expose sensitive recordings if users are not adequately informed or if untrusted file paths are supplied.
signed_url = self.create_signed_url(self.host_url, "POST")
print("Calling song recognition API...")
response = requests.post(
signed_url,
json=request_body,
timeout=self.timeout