T09 · Insecure Skill Coding Practices
- Location
build_chart.py:29- Finding
Hardcoded Bearer Credential in Source Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill does generate local API charts, but it ships an embedded bearer credential, silently falls back to demo data, and returns unsanitized active HTML.
Review this skill before installing. It should remove the embedded bearer token, require administrator-provided credentials, fail clearly instead of silently returning demo data, validate all user-derived parameters, generate HTML with proper escaping, and pin or bundle the charting library.
build_chart.py:29Hardcoded Bearer Credential in Source Code
SKILL.md:25Shell Command Injection Exposure in the Documented Execution Workflow
build_chart.py:70HTML and JavaScript Injection Through an Unescaped Chart Title
build_chart.py:75Unpinned Third-Party Script Executed Without Integrity Verification
The documented behavior materially differs from the described purpose: the skill appears to rely on command-line arguments instead of true natural-language parameter extraction, uses a hardcoded Bearer token for local API access, and may silently fall back to demo data on failure. Hardcoded credentials risk secret leakage and misuse, while undisclosed fallback behavior can mislead users into trusting fabricated or non-live results.
A sensitive authorization token is sent in outbound requests without any disclosure to the user that the skill contains and uses privileged credentials. This increases the risk of secret exposure, unauthorized API use, and hidden access to protected internal data, especially in an agent skill context where users may assume only unauthenticated local processing occurs.
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
ment:
condition["displacement"] = [displacement]
params = {"condition": condition, "select_options": []}
temporary_name = ["37a7e623"]
try:
session = requests.Session()
session.trust_env = False
response = session.post(url_, json=params, timeout=10, headers={"Content-Type": "application/json","Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NDg2MywidXNlcm5hbWUiOiJMQUlYVUZFSSIsImV4cCI6MTc3ODgzNDQwNiwiaWF0IjoxNzc2MjQyNDA2LCJpc3MiOiJCRkNFQyIsImF1ZCI6IkRYUCJ9.BrHo5EKoLo8G-pUK6uoYJli1v3305egFMtwVhlXXcAY"})
if response.status_code == 200:
temporary_name = response.json().get("data", ["37a7e623"])
except Exception as e:
pass
url = "http://127.0.0.1:9080/api/cdas/torque_proportion"
params = {"condition":{"dataday":[time_range[0],time_range[1]], "temporary_name":temporary_name},"retrieval":[],"x_data":"func_deal_torque_range100(actual_torque)"}
try:
session = requests.Sessio
The skill instructs execution of a local Python script that calls an API, but it declares no explicit tool scope or permissions boundaries. This creates an authorization and transparency gap: an agent may invoke network-capable behavior without the caller being clearly informed or the runtime enforcing least privilege.
The documented required response format hard-codes <html lang="zh-CN">, which imposes a specific locale on all outputs. This is a natural-language policy concern because the skill does not indicate that users may choose another language or that the locale restriction is optional or justified.
The skill hardcodes a bearer token directly in source and automatically uses it to access local APIs. Even though the endpoint is localhost, embedded credentials can be extracted, reused, and abused by anyone who can read the skill or its outputs, and the capability exceeds simple chart rendering because it silently grants authenticated access to protected data services.
The HTML and chart labels are hard-coded to Chinese language settings and text, such as lang="zh-CN" and Chinese UI labels. This imposes a specific language/locale on all users without opt-in or explanation, which matches the policy's language/locale violation criteria.
The description says the skill accepts natural-language instructions broadly and automatically extracts parameters, which creates an overly permissive activation surface. In a skill that calls a local API and returns generated HTML, broad triggering increases the chance of unintended invocation, unsafe parameter inference, and misuse of local resources or sensitive data paths.
The skill description is written entirely in Chinese and presents the capability as Chinese-oriented without indicating that users can choose another language or that the skill is intentionally restricted to a Chinese-language context. This can violate language/locale policy when no opt-in or justification is provided.
The generated HTML loads ECharts from a public CDN, creating an external network dependency in a skill that is described as using local APIs only. This can leak usage metadata, break in restricted environments, and expose users to supply-chain risk if the CDN resource is unavailable or tampered with.
No suspicious patterns detected.