T09 · Insecure Skill Coding Practices
- Location
scripts/happynewyear.py:89- Finding
Hard-Coded API Credentials Exposed in Source Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does generate New Year fortune videos, but it also sends personal details to external AI services and modifies the local environment in unsafe, under-disclosed ways.
Review carefully before installing. Use only in an isolated disposable environment, avoid entering real names, exact birth details, birthplace, or private wishes, and require the publisher to remove hardcoded credentials, restore TLS verification, stop runtime package and driver downloads, and add clear third-party data disclosure and consent controls.
scripts/happynewyear.py:89Hard-Coded API Credentials Exposed in Source Code
scripts/happynewyear.py:202TLS Certificate and Hostname Verification Disabled
scripts/happynewyear.py:32Automatic Installation of Unpinned Dependencies at Runtime
scripts/happynewyear.py:785Runtime Browser-Driver Retrieval Followed by Local Execution
scripts/happynewyear.py:286Undisclosed Transmission of Personal and Profile-Derived Data to External Services
The declared purpose presents the skill as a simple video generator, but the documented behavior includes dependency installation, outbound requests to multiple external services, hardcoded API credential use, remote asset fetching, and execution of subprocesses like pip, ffmpeg, and browser tooling. This mismatch is dangerous because it hides materially riskier behavior from reviewers and users, enabling secret exfiltration of personal input, supply-chain exposure, and execution of powerful binaries under the guise of a benign media task.
The skill automatically installs packages and invokes pip/browser/media tooling beyond what users would reasonably expect from a simple fortune-generation skill. This is dangerous because it allows remote code from package repositories and downloaded tooling to execute in the host environment, creating a strong supply-chain and environment-modification risk.
The code globally disables TLS hostname and certificate verification for outbound HTTPS requests, making all API and asset downloads vulnerable to man-in-the-middle interception or tampering. Because this skill transmits personal user data and consumes remote model/image/audio responses, an active network attacker could steal secrets, alter content, or deliver malicious payloads.
This code sends detailed personal information provided by the user—such as name, gender, birth data, and wishes—to a remote LLM API without explicit disclosure or confirmation. In the context of a fortune-telling skill, this is especially sensitive because the data is intimate and unnecessary to transmit without informed consent and clear privacy boundaries.
The skill declares no explicit tool scope or permissions even though the documented dependencies and behavior imply filesystem access, network use, and process execution. In an agent environment, this creates a transparency and least-privilege failure: operators and users cannot accurately assess what the skill may do, increasing the chance of unauthorized data access, downloads, or command execution.
The description is written as producing a specific Chinese New Year fortune video and does not indicate that users can choose output language or locale. This may violate language/locale policy if the skill implicitly forces Chinese output without opt-in or documented regional justification.
The skill explicitly collects personal information such as name, gender, birth date, personality, and wishes, yet the description provides no privacy notice, retention policy, minimization guidance, or warning that this data may be sent to external services. Because the skill also appears to use networked AI, image, and TTS services, users may unknowingly expose sensitive personal data to third parties.
The top-level documentation presents the script as a '纯净版' and says other logic remains unchanged, implying a limited presentation-layer adjustment. In reality, the script contains significant side-effecting behavior such as runtime package installation, remote API calls, browser automation, and ffmpeg/subprocess execution.
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
for lib in required_libs:
try:
import_name = lib.replace("-", "_")
__import__(import_name)
except ImportError:
missing_libs.append(lib)
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
for lib in required_libs:
try:
import_name = lib.replace("-", "_")
__import__(import_name)
except ImportError:
missing_libs.append(lib)
The generated HTML and overall user-facing interaction are explicitly fixed to Chinese, including the HTML lang attribute and multiple prompts/instructions, with no indication that the user can choose another language. This can violate language/locale policy where skills must not force a specific language without user opt-in.
The script auto-installs packages via pip during execution without a user-facing warning or approval step. This is dangerous because it changes the environment and executes third-party package code unexpectedly, which is a serious trust and supply-chain concern for end users.
This line silently runs pip at execution time to install packages from a remote mirror, which expands the skill's capabilities and executes unreviewed third-party code in the current environment. In a skill that should generate a fortune video, automatic package installation is dangerous because it can introduce supply-chain compromise, persistence, and unexpected code execution without informed user consent.
"--quiet",
"--root-user-action=ignore"
]
subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
time.sleep(1)
except subprocess.CalledProcessError:
cmd = [
This fallback pip invocation performs the same unsafe behavior, but with visible output instead of quiet mode. It still executes package installation from a remote source during skill runtime, creating a supply-chain and arbitrary code execution risk unrelated to the user's stated task.
*missing_libs,
"-i", "https://pypi.tuna.tsinghua.edu.cn/simple"
]
subprocess.check_call(cmd)
if optional_missing:
try:
This line silently installs an optional rendering package at runtime, again executing code fetched from the network without user approval. Even though the package is optional, the behavior increases attack surface and can lead to supply-chain compromise in environments that merely attempt to use the skill.
cmd = [sys.executable, "-m", "pip", "install", "imgkit",
"-i", "https://pypi.tuna.tsinghua.edu.cn/simple",
"--quiet", "--root-user-action=ignore"]
subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
elif "selenium" in optional_missing and "webdriver-manager" in optional_missing:
cmd = [sys.executable, "-m", "pip", "install", "selenium", "webdriver-manager",
"-i", "https://pypi.tuna.tsinghua.edu.cn/simple",
This installs Selenium and webdriver-manager at runtime, which significantly broadens execution and network capabilities by pulling browser automation components on demand. That is an unjustified expansion for a fortune-video skill and creates supply-chain, remote download, and browser-tooling abuse risks.
cmd = [sys.executable, "-m", "pip", "install", "selenium", "webdriver-manager",
"-i", "https://pypi.tuna.tsinghua.edu.cn/simple",
"--quiet", "--root-user-action=ignore"]
subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except Exception:
pass
The generated fortune text is sent to an external TTS provider without explicit disclosure to the user. While less sensitive than raw birth details, it still exports user-derived personal content to a second third party and compounds privacy exposure.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
mixed_out_path
]
try:
subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
return mixed_out_path
except Exception:
return None
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
mixed_out_path
]
try:
subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
return mixed_out_path
except Exception:
return None
Detected: suspicious.exposed_secret_literal, suspicious.insecure_tls_verification