T09 · Insecure Skill Coding Practices
- Location
payment_utils.py:226- Finding
Payment Credential Verification Fails Open
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill largely matches its paid A-share premarket report purpose, but it under-discloses automatic loading of code from another local skill directory and has weak payment and dependency controls.
Install only after reviewing the publisher and running it in an environment where the broad file, network, and environment-variable access is acceptable. Avoid having an untrusted ~/.openclaw/skills/tushare-finance/scripts/api_client.py present, consider pinning dependencies before use, and treat the payment/licensing checks as weak rather than a strong security boundary. I did not find destructive actions or secret exfiltration in the reviewed files.
payment_utils.py:226Payment Credential Verification Fails Open
pre_market.py:130Automatic Execution of Code from an External Sibling Skill Directory
requirements.txt:1Mutable and Unpinned Third-Party Dependencies
The declared purpose omits several materially relevant behaviors: payment verification utilities, local archive extraction, broad external network access, and persistent reads/writes to local directories. That mismatch reduces informed consent and can cause agents or users to run a skill with broader trust assumptions than warranted, especially because it touches local files, secrets, and external services.
The declared purpose omits several materially relevant behaviors: payment verification utilities, local archive extraction, broad external network access, and persistent reads/writes to local directories. That mismatch reduces informed consent and can cause agents or users to run a skill with broader trust assumptions than warranted, especially because it touches local files, secrets, and external services.
The file implements a full local payment and credential-verification workflow even though the skill is ներկայացված as a stock premarket analysis tool. This capability mismatch is dangerous because it introduces hidden monetization and credential-handling behavior outside the user’s expected trust boundary, increasing the risk of unauthorized billing flows, sensitive token exposure, and deceptive functionality.
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
�部侍郎-A股盘前作战地图"
# SM4 密钥 (Base64, 16字节) - 由京东邮件提供
# 🚨 安全修复: 移除硬编码默认值,延迟到实际使用时检查
_SM4_KEY_BASE64 = os.environ.get("CLAWTIP_SM4_KEY")
# ClawTip 收款服务ID (payTo) - base64编码,防肉眼直接提取
# 注意: 实际值通过 base64 解码 _PAY_TO_B64 获得,不在注释中明文存储
_PAY_TO_B64 = "ODVhZTg5NWMxYTA4YTdlMmVmZTVmMThiNzM5ZTMzMzcyMDI2MDQxODE0MjIyODAwMjAwMDY5ODhERnRtclNBdkdoRWFacDNsemtrcGJuS29mWFRnQnNmc1I2aWF6ek9iQnY0anF5akNzcjk4ZlZDZjRsUldEUmp0eXFaTVFpQVk="
_PAY_TO = base64.b64decode(_PAY_TO_B64).decode("utf-8")
def _require_sm4_key():
"""延迟校验 SM4 密钥,避免 import 时直接崩溃"""
key = os.environ.get("CLAWTIP_SM4_KEY") or _SM4_KEY_BASE64
if not key:
print("[支付] 🚨 CLAWTIP_SM4_KEY 未设置")
print("[支付] 💡 export CLAWTIP_SM4_KEY='你的SM4密钥'")
sys.exit(1)
return key
# 标准订单路径: ~/.openclaw/
The code claims release builds strictly verify payment credentials, but actually bypasses verification whenever the file path contains the substring "libu-research". This is a weak, spoofable trust check: an attacker can place or rename the skill into a matching path to disable payment verification, undermining the integrity of the enforcement logic and indicating deliberate hidden bypass behavior.
The skill documentation declares no explicit tool scope or permissions even though its described operation clearly requires environment-variable access, local file read/write, archive extraction, and network access. This weakens user and platform visibility into what the skill can do, increasing the chance that it is granted broader access than expected and making review harder.
The natural-language content throughout the skill README is exclusively Chinese, including setup, payment, warnings, and support instructions. The policy requires flagging skills that force a specific language without user opt-in unless the locale constraint is clearly documented and justified, which is not present here.
Using npx clawhub@latest install libu-premarket pulls and executes the latest package version at install time, which is a supply-chain risk. If the upstream package is compromised or a breaking release is published, users may execute unreviewed code during installation.
The user-facing description is entirely in Chinese and does not indicate any language choice or opt-in. Under the policy criteria, forcing a specific language or locale without offering an alternative is a natural-language policy violation.
This Python file contains core module documentation entirely in Chinese, and later user-facing status/help messages are also emitted only in Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.
The skill includes local order creation, credential ingestion, and payment verification capabilities that are not justified by the stated stock-analysis purpose. Even if the crypto checks are intended as protection, the mere presence of billing integration expands the attack surface by writing payment artifacts to local disk and trusting local file-based state that other local processes may tamper with.
This code file contains user-facing natural-language strings and documentation in Chinese only, starting from the module docstring and continuing throughout the script. Under the language/locale policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly justified.
The script embeds payment enforcement logic that is unrelated to its stated stock-selection function and gates execution based on local environment conditions. While not directly a classic vulnerability like RCE, it introduces hidden control-flow and trust decisions inside the skill, increasing supply-chain and user-trust risk because behavior depends on bundled monetization code rather than the advertised task.
This markdown file contains user-facing natural language entirely in Chinese, including release headings and descriptions, with no indication that the skill is region-specific or that users can opt into a language. Under the policy rule for language/locale constraints, forcing a specific language without documented choice or justification is a natural-language policy concern.
Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.
# 标准库调用方式:api.fina_indicator(...)
# 自定义库调用方式:api.pro.fina_indicator(...)
if API_TYPE == "standard":
func = getattr(API_OBJ, method_name)
else:
func = getattr(API_OBJ.pro, method_name)
return func(**kwargs)
Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.
if API_TYPE == "standard":
func = getattr(API_OBJ, method_name)
else:
func = getattr(API_OBJ.pro, method_name)
return func(**kwargs)
except Exception as e:
print(f"[Tushare Error] {method_name}: {e}")
The dependency is specified with a lower bound only, which allows installation of any newer release and makes builds non-reproducible. This increases supply-chain risk because a future vulnerable or malicious upstream version could be resolved without review, and it also prevents auditors from knowing exactly which version is deployed.
pandas>=1.5.0
requests>=2.28.0
numpy>=1.23.0
tushare>=1.2.89
Because pandas is unpinned, it is impossible to verify from this manifest whether the installed version is affected by known advisories. The direct risk depends on the actual resolved version, but the manifest itself creates an auditability gap that can hide vulnerable deployments.
Using requests>=2.28.0 permits unreviewed future versions to be installed, which weakens reproducibility and dependency assurance. Because requests has a history of security advisories, leaving it unpinned makes it harder to determine exposure and raises the chance of pulling an unsafe release.
pandas>=1.5.0
requests>=2.28.0
numpy>=1.23.0
tushare>=1.2.89
gmssl>=3.2.0
requests has multiple known advisories, and the absence of exact version pinning means the deployed version cannot be assessed from the manifest alone. Since this package is commonly used for outbound HTTP and can affect credential handling, redirects, and TLS-related behavior, unverifiable versioning materially increases operational security risk.
A minimum-only version for numpy allows dependency drift across environments and time. That can introduce vulnerable or incompatible upstream releases unexpectedly and makes incident response and SBOM verification more difficult.
pandas>=1.5.0
requests>=2.28.0
numpy>=1.23.0
tushare>=1.2.89
gmssl>=3.2.0
The manifest does not identify an exact numpy release, so any known advisories affecting some versions cannot be ruled out. Even if exploitation depends on application usage, this uncertainty is itself a supply-chain weakness because operators cannot confidently prove they are on a safe version.
The tushare dependency is not pinned to an exact version, so future installs may resolve to different code than what was tested. For a data-driven financial skill, this creates supply-chain and reliability risk because unexpected upstream changes could affect behavior or security.
pandas>=1.5.0
requests>=2.28.0
numpy>=1.23.0
tushare>=1.2.89
gmssl>=3.2.0
gmssl is also unpinned, which is more sensitive than a generic utility package because cryptographic libraries affect confidentiality and integrity decisions. Allowing arbitrary newer versions without review increases the risk of silently introducing a flawed or malicious crypto implementation.
requests>=2.28.0
numpy>=1.23.0
tushare>=1.2.89
gmssl>=3.2.0
No suspicious patterns detected.