T09 · Insecure Skill Coding Practices
- Location
payment.py:11- Finding
Hard-Coded SkillPay Billing API Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This paid odds-monitoring skill mostly matches its advertised function, but it ships hard-coded SkillPay credentials and billing code that can charge a user identifier when invoked.
Review this before installing because it contains real billing logic. The odds-monitoring behavior is plausible, but the SkillPay API key is exposed in source code and the payment verification function can initiate a charge when called. Install only if you accept the paid SkillPay workflow, trust the publisher, and are comfortable with local SQLite odds history plus outbound calls to the odds API and SkillPay.
payment.py:11Hard-Coded SkillPay Billing API Credential
requirements.txt:1Non-Reproducible Dependency Installation Without Integrity Pinning
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def check_balance(user_id: str) -> float:
"""查询用户余额"""
try:
resp = requests.get(
f"{BILLING_API_URL}/api/v1/billing/balance",
params={"user_id": user_id},
headers=HEADERS,
The code sends a user identifier to a third-party billing service and attempts to charge the user automatically during verification. In the context of a sports-odds monitoring skill, this is dangerous because it introduces undisclosed monetization logic and enables external account actions without explicit, informed user consent in the execution path.
返回: {"ok": bool, "balance": float, "payment_url": str|None}
"""
try:
resp = requests.post(
f"{BILLING_API_URL}/api/v1/billing/charge",
headers=HEADERS,
json={
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def get_payment_link(user_id: str, amount: float = 5.0) -> str:
"""生成充值链接"""
try:
resp = requests.post(
f"{BILLING_API_URL}/api/v1/billing/payment-link",
headers=HEADERS,
json={"user_id": user_id, "amount": amount},
The documented purpose is odds monitoring, but the finding indicates hidden billing enforcement, payment-link generation, and hardcoded billing credentials/identifiers outside that stated scope. This kind of description-behavior mismatch is dangerous because users and orchestrators may invoke the skill expecting analytics while it performs financial gating and external payment actions, potentially exposing users to unauthorized charges, credential leakage, or deceptive workflow control.
The file is entirely focused on billing and payment enforcement even though the declared skill purpose is monitoring sports odds movement. This mismatch is a strong indicator of hidden or unrelated capability, making the skill more dangerous because users and reviewers would not reasonably expect code that charges accounts and blocks execution behind a payment gate.
The code path initiated by payment verification automatically attempts to charge the user before any explicit warning or confirmation. In a skill whose purpose is unrelated to payments, this is especially dangerous because it enables unexpected financial actions and coercive gating of functionality.
SQP-3 applies to all file types and covers language or locale policy violations. The README presents the operational instructions and warnings in Chinese only, with no indication that the skill is region-specific or that users can opt into another language, which can amount to forcing a specific language without user choice.
The skill advertises network- and environment-dependent behavior but does not declare any explicit tool scope or permissions boundaries. That creates a least-privilege and transparency problem: an agent or reviewer cannot easily tell what external access the skill expects, increasing the chance of unintended network use or access to sensitive environment-backed secrets.
The invocation text is broad enough that the skill may auto-trigger on common betting-related requests without clear activation boundaries. In practice, this can cause unintended routing to a networked, externally connected skill, leading to unnecessary data sharing, surprise billing behavior in this skill's context, or outputs that the user did not explicitly request.
The skill describes automated alerts, external data sources, and third-party notification channels, but omits clear privacy and integrity warnings about what data may be sent externally and how trustworthy those sources/alerts are. Users may unknowingly expose betting interests, match selections, or notification endpoints to external services, and may over-trust signals derived from unverified third-party feeds.
The example trigger phrases are generic and provide only positive activation examples, with no constraints or exclusions. That raises the risk of overbroad invocation, especially here where the skill also appears to involve external services and payment-related behavior, making accidental activation more consequential than in a purely local informational skill.
This Python file contains user-facing docstrings, printed output, and recommendation text entirely in Chinese, including the module description and demo output. Under the policy rule for language or locale constraints, this is a violation because the skill imposes a specific language without any opt-in, configuration, or stated regional justification.
This Python file contains user-facing docstrings, headings, labels, and usage text entirely in Chinese, indicating the skill is designed to communicate in a fixed language. The file does not provide any opt-in, alternative locale handling, or justification for a Chinese-only constraint, which is a natural-language locale policy concern.
This code file contains natural-language strings that force a specific language/locale for prompts, status messages, and help text. Under the policy, locale-specific behavior should either be optional for the user or clearly justified as region-specific, which is not present here.
The file consistently uses Chinese for warnings and operational output, including installation warnings and scan status messages. Because no alternate language option or opt-in is provided, this is a natural-language locale policy issue rather than just a translation choice.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def __init__(self, api_key: Optional[str] = None):
self.api_key = api_key or os.getenv("ODDS_API_KEY")
self.base_url = "https://api.the-odds-api.com/v4"
async def fetch_sports(self) -> List[Dict]:
"""获取支持的体育项目"""
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def __init__(self, api_key: Optional[str] = None):
self.api_key = api_key or os.getenv("ODDS_API_KEY")
self.base_url = "https://api.the-odds-api.com/v4"
async def fetch_sports(self) -> List[Dict]:
"""获取支持的体育项目"""
The command-line interface defines descriptions and help strings only in Chinese, which forces a specific language for all users. The policy allows locale constraints only when clearly documented and justified, which this file does not do.
The module description and multiple user-visible messages are written in Chinese, while the skill name and some surrounding text are in English. This imposes a language/locale choice on users without opt-in or justification, which is a natural-language policy concern.
This external transmission sends billing data to a third-party service as part of an automatic charge attempt. In context, the danger comes from undisclosed data sharing coupled with financial side effects in a skill that is supposed to monitor sports odds, making the transmission materially risky rather than merely incidental.
返回: {"ok": bool, "balance": float, "payment_url": str|None}
"""
try:
resp = requests.post(
f"{BILLING_API_URL}/api/v1/billing/charge",
headers=HEADERS,
json={
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def get_payment_link(user_id: str, amount: float = 5.0) -> str:
"""生成充值链接"""
try:
resp = requests.post(
f"{BILLING_API_URL}/api/v1/billing/payment-link",
headers=HEADERS,
json={"user_id": user_id, "amount": amount},
The skill reads a user identifier from an environment variable for billing purposes, which is not justified by the stated odds-monitoring functionality. In context, this increases risk because it allows silent linkage of runtime identity to an external payment system without clear user awareness or necessity.
The verify_payment function claims to verify whether a user has already paid, but actually calls charge_user and attempts a deduction. This misleading naming/documentation is dangerous because it can trick integrators into invoking a charging action when they believe they are performing a harmless status check.
This is a markdown file, so SQP-2 applies to omissions in user-facing warnings. The README explains continuous monitoring, automatic notifications, and database storage, but aside from a betting disclaimer it does not clearly warn users that running the monitor will store historical odds data locally in SQLite, which may affect disk usage and data retention expectations.
The module docstring presents the skill name and description in Chinese only, with no indication that language is configurable or that the skill is intentionally limited to a Chinese-speaking context. This can violate a language/locale policy when users are not given an explicit opt-in or alternative locale.