T09 · Insecure Skill Coding Practices
- Location
scripts/odps_helper.py:69- Finding
ODPS Connections Default to Plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears intended for ODPS data work, but it can run unrestricted SQL with cloud credentials and may default to plaintext HTTP connections.
Review before installing. Use only a dedicated read-only ODPS/RAM identity with minimal project and table access, set the script's actual ALIYUN_ACCESS_KEY_ID, ALIYUN_ACCESS_KEY_SECRET, ALIYUN_ODPS_PROJECT, and ALIYUN_ODPS_ENDPOINT variables explicitly, require an HTTPS endpoint, and avoid running it from directories containing unrelated .env files.
scripts/odps_helper.py:69ODPS Connections Default to Plaintext HTTP
scripts/odps_helper.py:130Unrestricted SQL Execution Using the Configured ODPS Principal
SKILL.md:22Unpinned PyODPS Dependency Installation
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# ODPS Skill 配置文件
# 使用步骤:
# 1. 将此文件复制为 .env: cp config.example.env .env
# 2. 填写下方的实际配置值
# 3. .env 文件仅供本地使用,请勿提交到代码仓库
The script intentionally searches for a .env file in the current working directory before the skill directory, which can cause it to load secrets from an unexpected, attacker-influenced location if run in an untrusted directory. In a CLI skill context, this broadens the trust boundary and can lead to credential confusion, use of attacker-supplied endpoints, or accidental use of wrong cloud accounts.
"""
从 .env 文件加载配置,加载路径按顺序查找:
1. 当前工作目录下的 .env
2. 脚本所在目录的上一级(skill/)目录下的 .env
已有的环境变量不会被覆盖(系统/shell 设置优先)。
"""
candidates = [
This code loads .env from os.getcwd(), which is a weaker trust model than loading from a controlled application path. If the tool is invoked from a directory containing a malicious or stale .env, it may silently consume attacker-chosen credentials or endpoint settings, affecting which ODPS environment it queries and potentially exposing sensitive data to the wrong tenancy.
已有的环境变量不会被覆盖(系统/shell 设置优先)。
"""
candidates = [
os.path.join(os.getcwd(), ".env"),
os.path.join(os.path.dirname(__file__), "..", ".env"),
]
for dotenv_path in candidates:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
candidates = [
os.path.join(os.getcwd(), ".env"),
os.path.join(os.path.dirname(__file__), "..", ".env"),
]
for dotenv_path in candidates:
dotenv_path = os.path.normpath(dotenv_path)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
candidates = [
os.path.join(os.getcwd(), ".env"),
os.path.join(os.path.dirname(__file__), "..", ".env"),
]
for dotenv_path in candidates:
dotenv_path = os.path.normpath(dotenv_path)
The skill declares required environment capabilities and instructs use of credential-bearing variables, but it does not explicitly constrain tool scope via permissions or allowed-tools. In an agent framework, that ambiguity can let the skill be invoked with broader execution context than intended, increasing the chance of unauthorized command execution or secret exposure.
The trigger guidance is broad enough to match many generic data-analysis requests, which can cause unintended invocation of a skill that executes Python and accesses cloud-backed data. Because this skill can run queries against ODPS using configured credentials, accidental activation expands the risk of unnecessary data access or execution in contexts where the user did not specifically request MaxCompute interaction.
This file contains user-facing instructional text entirely in Chinese, including setup steps and configuration guidance. The stated policy flags language or locale constraints when a skill forces a specific language without user opt-in, and there is no indication here that Chinese is optional or justified as a region-specific requirement.
This markdown file contains natural-language instructions exclusively in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without opt-in can be a locale-policy violation.