T09 · Insecure Skill Coding Practices
- Location
scripts/run_weighted_backlink_plan.sh:5- Finding
Arbitrary Shell Code Execution Through Sourced Environment File
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its SEO planning purpose, but its runner can execute shell code from a configurable secrets file before generating the plan.
Install only if you control the env file and CSV inputs. Run it as an unprivileged user, do not point AI_SBTI_SKILL_TEST_ENV_FILE at untrusted files, and review generated Markdown as untrusted content when prospect data comes from outside sources.
scripts/run_weighted_backlink_plan.sh:5Arbitrary Shell Code Execution Through Sourced Environment File
scripts/build_weighted_backlink_plan.py:202Markdown Content Injection Through Unsanitized CSV Fields
The skill clearly instructs the agent to read and write local files and run scripts that may perform network-related SEO operations, but it does not declare any explicit tool scope or allowed permissions in the metadata. This creates an authorization ambiguity where an execution environment may grant broader capabilities than reviewers expect, increasing the risk of unintended file access, secret handling, or outbound actions.
The main skill heading is presented in Chinese ('基于AI的SBTI技能测试') while the rest of the file is otherwise English-oriented, and the document does not state that Chinese is optional or required for a justified region-specific use case. This can violate a language/locale policy when a skill implicitly constrains presentation or interaction language without user choice.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
mkdir -p /root/.openclaw/workspace/.secrets
cp skills/ai-sbti-skill-test/config/ai-sbti-skill-test.env.example
/root/.openclaw/workspace/.secrets/ai-sbti-skill-test.env
chmod 600 /root/.openclaw/workspace/.secrets/ai-sbti-skill-test.env
Generate weighted execution plan:
The script automatically sources an environment file from a fixed secrets path before running an SEO-planning task, creating an unnecessary trust boundary and exposing the process to any variables or shell-side effects defined there. Even though the path is quoted and sourced conditionally, loading unrelated secrets into the runtime can leak sensitive data to child processes or let a tampered env file influence behavior unexpectedly.
The script silently sources a potentially sensitive environment file with source, which executes shell content rather than merely parsing key-value pairs. If that file is modified, replaced, or unexpectedly populated with shell commands, those commands run in the script's context, making this more dangerous than simple configuration loading—especially since an SEO skill has no obvious need to consume privileged secrets from a workspace secrets directory.
The script defines output paths for markdown and JSON artifacts and creates their parent directories, which indicates it will write files to the filesystem. There is no confirmation prompt, user-facing echo/log message, or explanatory comment/docstring in this file disclosing that it will create or overwrite these outputs.
The display name is in Chinese while the short description and default prompt are in English, and the file provides no indication that language is selectable by the user. This can create a language/locale policy issue because the skill implicitly imposes inconsistent language behavior without opt-in or documented justification.