T09 · Insecure Skill Coding Practices
- Location
payment.py:11- Finding
Hard-Coded Billing API Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches an odds-monitoring purpose, but its bundled billing code exposes a hard-coded payment API key and can perform user-linked charge operations without clear per-charge user control.
Review this skill before installing. Its core odds-monitoring behavior is coherent, but the included billing module should be fixed to remove and rotate the embedded SkillPay key, use deployment-specific secrets, authenticate billing identity server-side, and require explicit user approval before any charge. Users should also expect outbound calls to the odds provider, local SQLite data retention, and Chinese-language output.
payment.py:11Hard-Coded Billing API Credential
monitor.py:208Odds API Credential Transmitted in URL Query Parameters
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 charges an account using a user ID taken from an environment variable, with no visible authentication, integrity check, or user confirmation. If an attacker or hosting environment can set SKILLPAY_USER_ID, they may trigger charges against another user's billing identity or abuse the billing flow, and this is made more dangerous by the automatic charge on skill start.
返回: {"ok": bool, "balance": float, "payment_url": str|None}
"""
try:
resp = requests.post(
f"{BILLING_API_URL}/api/v1/billing/charge",
headers=HEADERS,
json={
The function sends an environment-derived user ID to an external payment-link endpoint, which can generate a user-specific payment URL for whichever ID is supplied. If the user ID can be manipulated, this may expose payment artifacts tied to another account and facilitate account enumeration or social engineering around billing.
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 skill also introduces payment gating, external billing interactions, recharge link generation, and hardcoded billing credential usage. This is dangerous because it hides financially sensitive behavior behind an unrelated description, reducing informed consent and making abuse, credential leakage, or unauthorized charging harder to detect.
The file implements a full billing and payment-enforcement workflow, but the skill is described as an odds-movement monitor. This mismatch is a strong indicator of hidden or undeclared behavior, and in agent skills such undisclosed monetization logic is especially risky because it can charge users or transmit data outside the stated purpose.
External payment-processing capability is unrelated to monitoring sportsbook odds and introduces sensitive financial side effects not justified by the advertised function. In this context, that makes the code more dangerous because users invoking an analytics skill would not reasonably expect automatic payment operations or communication with a third-party billing service.
The skill advertises capabilities that imply network and possibly environment access, but it does not declare any explicit tool scope or permissions. This creates an authorization and review gap: operators and users cannot easily verify what external access the skill requires, increasing the risk of overprivileged execution or hidden data flows.
The primary description is written entirely in Chinese and presents the skill's purpose and usage in that language without indicating multilingual support or user opt-in. This can violate language/locale policy guidance when a skill implicitly requires a specific language rather than offering a choice.
This Python file's natural-language descriptions and user-facing messages are written exclusively in Chinese, starting with the module description. The policy requires avoiding forced language or locale constraints unless the user is given a choice or the regional limitation is clearly documented and justified, which is not present here.
This code file contains user-facing natural-language strings such as the module description, scenario labels, summaries, and usage instructions exclusively in Chinese. Because the skill does not provide any opt-in, fallback, or explanation that it is intended only for Chinese-speaking users, it creates a language-policy violation under the locale-choice requirement.
The script prepends a user-home workspace path to sys.path, causing Python imports to resolve from an uncontrolled local directory before standard locations. If an attacker or another local process can modify that directory or its modules, running the demo can execute arbitrary code via import-time side effects, making this a real code-loading vulnerability.
This code file contains user-facing natural-language descriptions and runtime messages entirely in Chinese, starting with the module docstring and continuing throughout the CLI/help text. Because the skill does not offer any user opt-in or language selection, it imposes a specific language/locale on users, which matches the policy-violation criterion for forced language 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]:
"""获取支持的体育项目"""
This external transmission sends billing data to a third-party endpoint as part of a charge operation. The network call itself is not inherently unsafe, but in this skill context it is security-relevant because it performs an undeclared financial action and transmits user-linked billing information outside the skill's stated odds-monitoring purpose.
返回: {"ok": bool, "balance": float, "payment_url": str|None}
"""
try:
resp = requests.post(
f"{BILLING_API_URL}/api/v1/billing/charge",
headers=HEADERS,
json={
This call transmits user-linked data to an external payment-link service. In isolation it is normal for payments, but in the context of an odds-monitoring skill with hidden billing behavior, the transmission increases privacy and abuse risk by involving a third-party payment service without clear necessity or disclosure.
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},
verify_payment triggers a charge as part of startup behavior, before any explicit just-in-time warning or consent from the user. This is dangerous because it creates an undisclosed financial side effect on normal use and can lead to unauthorized or surprising charges, especially in an agent context where execution may be automated.
The payment failure path prints a user-specific payment URL directly in output, which may be captured by logs, terminals, chat transcripts, or other observers. In a multi-tenant or agent-run environment, leaking payment URLs can expose sensitive billing artifacts and enable misuse or phishing-style abuse.
A language/locale policy issue applies across all file types when the skill effectively forces a specific language without user opt-in. This README uses Chinese throughout its instructions and descriptions, and does not indicate that the skill is intentionally region-specific or provide an alternative language option.
This markdown file documents a continuous monitoring mode and a SQLite database schema, which indicates ongoing data collection and retention. While the README explains the feature, it does not clearly warn users that running the monitor will persist collected data locally and continue operating until stopped.
The manifest description is written entirely in Chinese, which imposes a specific language context without any indication of user choice or opt-in. Under the policy, locale or language constraints should be optional or clearly justified; this file provides neither.
The file presents the skill description in Chinese (自动集成付费验证功能) alongside an English title, with no indication that language selection is optional or region-specific. This can violate language/locale policy when a specific language is imposed without user opt-in or justification.
The dependency specifier aiohttp>=3.8.0 is unpinned, so builds may resolve to different versions over time. This weakens supply-chain control, makes security review non-reproducible, and can accidentally introduce vulnerable or breaking releases into a network-facing skill.
aiohttp>=3.8.0
requests>=2.28.0
aiohttp has multiple known advisories, and because the manifest does not pin a version, it is impossible to verify whether the installed release is affected. In a real-time odds-monitoring skill that may make frequent HTTP calls, uncertain dependency state increases the chance of deploying a vulnerable client library in production.
The dependency specifier requests>=2.28.0 is unpinned, allowing future installs to pull different releases without review. For a monitoring skill that likely performs outbound HTTP requests, this increases supply-chain risk and complicates assurance that deployed versions are free from known issues.
aiohttp>=3.8.0
requests>=2.28.0