T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/music-search.sh:39- Finding
Arbitrary Local File Disclosure Through Bash Argument Expansion
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill broadly matches music-resource search, but its file-reading, URL-fetching, and runtime dependency installation behaviors need careful review before installation.
Install only if you are comfortable with a skill that performs live third-party crawling, can install Python packages at runtime, caches results locally, and currently has unsafe @file and URL-fetching behavior. Do not pass untrusted arguments to it, avoid using it in environments with sensitive local files or internal network access, and prefer a revised version that removes @file expansion, validates URLs, pins dependencies, and parses .env safely.
scripts/music-search.sh:39Arbitrary Local File Disclosure Through Bash Argument Expansion
scripts/music-search.ps1:48Arbitrary Local File Disclosure Through PowerShell Argument Expansion
scripts/music-search.js:892Server-Side Request Forgery in URL Resolution
scripts/deep_extract.py:146Server-Side Request Forgery in Deep Page Extraction
scripts/music-search.sh:24Arbitrary Command Execution Through Sourced Environment File
requirements.txt:1Automatic Installation of an Unpinned Third-Party Dependency
The declared purpose says the skill searches music resources from specific cloud-drive providers, but the documented output also includes magnet links and describes generic deep crawling and redirect resolution. This mismatch hides materially broader collection and link-extraction behavior, which increases the chance of unsafe invocation, policy bypass, or use for piracy/malware distribution beyond the stated scope.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
exit 1
}
# ---- Load .env configuration ----
$envFile = Join-Path $SkillDir ".env"
if (Test-Path $envFile) {
Get-Content $envFile | ForEach-Object {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
# ---- Load .env configuration ----
$envFile = Join-Path $SkillDir ".env"
if (Test-Path $envFile) {
Get-Content $envFile | ForEach-Object {
$line = $_.Trim()
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
# ---- Load .env configuration ----
$envFile = Join-Path $SkillDir ".env"
if (Test-Path $envFile) {
Get-Content $envFile | ForEach-Object {
$line = $_.Trim()
The script automatically loads and sources a .env file from the skill directory using the shell. Because source executes shell syntax rather than safely parsing key/value pairs, a modified .env can run arbitrary commands in the user's environment when the skill starts. In a skill ecosystem where package contents may be updated or tampered with, this increases risk beyond normal configuration loading.
exit 1
fi
# ---- Load .env configuration ----
if [ -f "$SKILL_DIR/.env" ]; then
set -a
# shellcheck disable=SC1091
The specific statement source "$SKILL_DIR/.env" causes the shell to execute the contents of the .env file. An attacker who can modify that file can achieve arbitrary code execution at skill launch, inheriting the user's privileges and exported environment. The surrounding '|| true' may also suppress errors and make malicious or malformed behavior less visible.
fi
# ---- Load .env configuration ----
if [ -f "$SKILL_DIR/.env" ]; then
set -a
# shellcheck disable=SC1091
source "$SKILL_DIR/.env" 2>/dev/null || true
The skill declares executable behavior that uses environment access and live network activity, but it does not define an explicit tool/permission scope. That creates a transparency and containment problem: an agent or reviewer cannot easily tell what capabilities are intended, and the skill may be granted broader execution than necessary.
The description lists trigger phrases including "找音乐" and especially "找歌", which are common conversational requests rather than narrowly scoped activation terms. Because the manifest does not provide exclusion conditions or tighter context constraints, these phrases may overlap with ordinary user speech and trigger the skill too broadly.
The skill performs live crawling of third-party pages, installs Python dependencies, and uses deep page fetching, but the top-level description does not prominently warn users that invocation causes active network requests and content retrieval. This lack of up-front disclosure can lead to unexpected outbound access to untrusted sites and exposure to malicious pages or sensitive browsing contexts.
The module docstring describes the skill entirely in Chinese, and later user-visible errors and status output are also Chinese-only. This imposes a specific language/locale on users without opt-in or any documented justification that the skill is region-specific, matching the language policy violation criteria.
The skill is described as searching cloud-drive music resources, but the code also extracts BitTorrent magnet links via MAGNET_PATTERN and returns them as results. This expands the capability beyond the declared scope, increasing legal/compliance risk and enabling distribution workflows the user and platform may not have expected or approved.
The skill launches external bash and Python subprocesses to perform search and extraction, adding interpreter execution and dependency on external scripts outside the main Node.js process. While execFile avoids classic shell injection, this still increases attack surface because compromised helper scripts, manipulated environment variables, or unexpected interpreter behavior can lead to unauthorized code execution or data access.
The skill automatically creates a Python virtual environment and installs dependencies at runtime, which introduces network access and code execution beyond its declared purpose of searching for music links. This expands the trust boundary significantly: package installation can fetch and execute unpinned third-party code, and doing so implicitly at runtime makes behavior less auditable and more dangerous in restricted or sensitive environments.
This code presents its primary usage text and multiple user-facing messages entirely in Chinese, which imposes a specific language on users without any opt-in or alternative locale path. The policy for natural-language behavior requires either user choice or a clearly documented, justified locale constraint.
Lines L25-L39 automatically ingest configuration from .env and set process environment variables, which can include sensitive credentials or alter downstream runtime behavior. Although the code is straightforward, there is no confirmation prompt, visible warning, or explanatory comment indicating to users that local secret-bearing configuration will be loaded.
This shell script includes natural-language comments and an emitted error message in Chinese, with no indication that another language can be selected. Under the policy rule for language/locale, forcing a specific language without user opt-in is a natural-language policy violation.
The note instructs users to search using Chinese artist and album or song names for best results, which effectively imposes a language preference in the skill guidance. The file does not offer an opt-in language choice or explain that the skill is intentionally limited to a Chinese-language corpus or region-specific use case.
The dependency is specified with a lower bound only (cloudscraper>=1.2.71), which allows installation of any newer version without review. This weakens build reproducibility and can unintentionally pull in a compromised, malicious, or breaking upstream release, increasing supply-chain risk for a skill that fetches external resources from the internet.
cloudscraper>=1.2.71