T09 · Insecure Skill Coding Practices
- Location
scripts/data_fetcher.py:39- Finding
Workspace-Level Environment File Is Loaded with Override Enabled
- Content
View full analysis
- Remediation
View remediation
/.env`, rather than traversing into the shared workspace. 2. Prefer explicit configuration injection by the invoking runtime. 3. Remove `override=True`; use `override=False` so trusted process variables retain precedence. 4. Do not import an entire environment file when only specific values are required. Parse and validate an allowlist containing only: - `MX_APIKEY` - `MX_APIKEY_BACKUP` - `TUSHARE_TOKEN` 5. Keep secrets in a dedicated secret manager where available. 6. Construct a minimal `env` dictionary for subprocesses instead of allowing them to inherit the complete process environment. 7. Restrict `.env` permissions to the owning user and document the exact secret scope the Skill requires. 8. Add tests confirming that unrelated variables are neither loaded nor overridden. ]]>
