T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
API key requested through chat and persisted in source code
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:20-24
Related Location:pixelhub_api_runner.py:13,pixelhub_api_runner.py:282-284
Vulnerability Type: Secret exposure through insecure collection and hardcoded storage
Risk Level: HighVulnerable Code
markdown 3. Tell the user to copy their own Pixelle API key and send it in chat. 4. After the user sends the key, replace `DEFAULT_API_KEY` in `pixelhub_api_runner.py`. 5. After the key is written, change this file's status line from `PENDING_USER_API_KEY` to `API_KEY_ADDED`. 6. After that, do not ask for the API key again unless the user wants to replace it.The destination in which the instructions require the key to be stored is:
python DEFAULT_API_KEY = "PENDING_USER_API_KEY"The runner also already supports an environment variable, making source-code persistence unnecessary:
python p.add_argument( "--api-key", default=os.getenv("Pixelhub_API_KEY", DEFAULT_API_KEY), help="Pixelhub API key", )Technical Analysis
The setup instructions explicitly require the user to disclose an API credential in chat and direct the agent to replace a constant in the Python source file with that credential. This creates two persistent secret-exposure surfaces:
- The credential remains in chat history and any associated telemetry, exports, or backups.
- The credential becomes part of the local skill source and can subsequently be copied, archived, shared, or committed to version control.
Storing the key in source code violates secret-management best practices and is not necessary for the skill's declared operation. The runner already reads
Pixelhub_API_KEYfrom the environment. A protected environment injection mechanism or credential store would provide the required authentication without modifying package files.No evidence indicates that the package contains a preinstalled real credential. The r ...[truncated 1167 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all instructions asking users to submit API keys through chat.
- Remove the instruction to replace
DEFAULT_API_KEYin the source file. - Require the existing
Pixelhub_API_KEYenvironment variable or integrate an operating-system credential store or managed secret provider. - Keep
DEFAULT_API_KEYas a non-secret sentinel and fail safely when no externally supplied credential is available. - Document secure, platform-specific secret injection without printing the key to the terminal or logs.
- Add secret-scanning controls to development and release workflows.
- Ensure local secret configuration files are excluded from source control.
- Advise users who followed the old procedure to remove the embedded key, delete exposed copies where possible, and rotate the credential through the Pixelle account portal.
