T09 · Insecure Skill Coding Practices
- Location
scripts/audit.py:148- Finding
Credential Configuration Is Written Without Enforcing Restrictive File Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a coherent API-key auditor, but its fix mode can persist secrets into OpenClaw configuration with insufficient safeguards and can migrate mcporter-managed credentials despite saying they do not need migration.
Review this skill before installing. Use read-only audit mode first. Avoid --fix unless you are comfortable copying detected secrets into openclaw.json, have checked the destination file permissions, and have verified that mcporter-managed keys will not be duplicated or exposed in an additional plaintext location.
scripts/audit.py:148Credential Configuration Is Written Without Enforcing Restrictive File Permissions
scripts/audit.py:135mcporter-Managed Credentials Are Incorrectly Duplicated During Automatic Migration
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
# 文件扩展名白名单
SCAN_EXTENSIONS = {'.py', '.sh', '.js', '.ts', '.json', '.yaml', '.yml', '.md', '.env'}
SKIP_DIRS = {'__pycache__', '.git', 'node_modules', '.venv', 'venv', 'dist', 'build'}
The skill advertises capabilities that imply reading and writing sensitive files, but it does not declare any explicit tool scope or permissions boundary. In practice, this increases the chance of overbroad file access or unintended credential modification because callers and reviewers cannot clearly see or constrain what the skill is allowed to do.
The skill includes an automatic '--fix' mode that writes discovered credentials into credential storage, but the documentation does not clearly warn users that this is a sensitive modification affecting secrets management. That omission can lead to accidental migration of live secrets, unsafe handling expectations, or users invoking a write operation without understanding the security consequences.
The file's natural-language documentation and user-facing messages are written in Chinese, which imposes a locale/language expectation without any visible opt-in or alternative. Under the policy, forcing a specific language without user choice is a natural-language policy concern unless the constraint is explicitly justified.
The skill reads ~/.mcporter/mcporter.json and extracts key material from MCP server URLs, which expands access beyond the declared purpose of scanning skills files and integrating with openclaw.json. Even though it uses those secrets only for classification, it still accesses unrelated credential sources and increases secret exposure surface without clear user consent or scope disclosure.
The --fix path persists discovered secrets into openclaw.json automatically, which can duplicate sensitive values onto disk without an explicit warning or confirmation step. This increases the number of stored plaintext secret copies and may create unintended retention or permission risks if openclaw.json is less protected than the original source.
The main flow automatically loads ~/.mcporter/mcporter.json during a normal scan, causing the skill to inspect credentials outside the stated scope of ~/.openclaw/workspace/skills and ~/.openclaw/openclaw.json. This violates least privilege and can surprise users by pulling in external secret material for trust decisions.
The natural-language description and invocation guidance are primarily in Chinese, which can impose a language expectation on users without explicit opt-in. The file does not indicate that the skill supports multiple languages or that the locale restriction is intentional and justified.
The docstring says these keys are managed by mcporter and '不需要抽取到 openclaw.json', which implies they are outside the migration target set. However, scan_skills_dir still appends such matches to all_findings and only adds a flag, so the behavior is to report them rather than truly omit them from extraction consideration.
No suspicious patterns detected.