T09 · Insecure Skill Coding Practices
- Location
scripts/wallpaper_skill.py:75- Finding
API Credential Exposure Through Command-Line Arguments and Arbitrary API Endpoint Redirection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly does what it says, but its API-token handling and configurable endpoint create a real credential-leak risk users should review before installing.
Install only if you are comfortable with a skill that changes your desktop wallpaper automatically and stores the generated image locally. Prefer using BAIDU_API_KEY from a protected environment rather than passing the token on the command line, do not use untrusted --base_url values, and consider pinning dependencies before use.
scripts/wallpaper_skill.py:75API Credential Exposure Through Command-Line Arguments and Arbitrary API Endpoint Redirection
requirements.txt:1Unbounded and Unverified Third-Party Dependency
The skill executes an external program (osascript), which is a shell/process-execution capability not reflected in the declared permissions. Even though the current call is constrained, undeclared process-launch capability materially increases risk because it can be repurposed for broader local actions and should be surfaced to users and policy controls.
The skill executes an external program (osascript), which is a shell/process-execution capability not reflected in the declared permissions. Even though the current call is constrained, undeclared process-launch capability materially increases risk because it can be repurposed for broader local actions and should be surfaced to users and policy controls.
The skill is designed to trigger on broad, everyday phrases like '换壁纸', '生成桌面', and '设置背景', which can plausibly appear in normal conversation without the user intending to authorize filesystem writes and system wallpaper changes. In this context, overbroad triggering is dangerous because the skill performs side effects on the local machine, including persistent file creation and modification of desktop settings.
The skill explicitly performs persistent writes to assets/wallpaper.png and changes the system wallpaper on Windows and macOS, but it does not require an explicit warning or confirmation immediately before those actions. This creates a real risk of surprising or unauthorized local side effects, particularly if the skill is mis-triggered or invoked from ambiguous user language.
The script presents user-facing status and error text in Chinese, such as the unsupported-platform message, and this pattern continues throughout the file. Because the skill does not offer language selection or justify a Chinese-only locale requirement, it violates the language/locale policy criteria.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
end run
"""
try:
subprocess.run(
["osascript", "-e", script, abs_path],
check=True,
capture_output=True,
The argparse description says the skill uses '百度文心 API', and the API key help text specifically instructs use of 'BAIDU_API_KEY'. However, the implementation imports OpenAI and calls client.images.generate(...) against a generic OpenAI-compatible API base URL. This is an active documentation-to-code contradiction about what backend/service the skill is actually using.
Natural-language content in the skill documentation appears to force a specific language for users reading or operating the skill, with no opt-in or alternative language guidance. Under the stated policy, a language constraint should either offer user choice or be clearly documented and justified.
The README explicitly describes functionality that generates a file and changes the system wallpaper, but it does not warn users that running the skill will modify local filesystem contents and desktop settings. In an agent-skill context, undeclared side effects are security-relevant because users or hosting agents may invoke the skill expecting content generation only, while it also performs persistent local changes.
The dependency is specified with only a lower bound (openai>=1.0.0), which allows installation of any newer major or minor release. This creates supply-chain and stability risk because future upstream changes or a compromised release could be pulled in automatically, leading to unexpected behavior or exposure in a skill that generates content and modifies the user's desktop environment.
openai>=1.0.0