T09 · Insecure Skill Coding Practices
- Location
SKILL.md:382- Finding
Hard-Coded API Token Exposed in Documentation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 382–389
Vulnerability Type: Hard-coded secret / plaintext credential exposure
Risk Level: MediumVulnerable Code
bash # Query the real-time quote for the Hong Kong stock Southern Double Long Hang Seng TECH curl -X GET "https://api.itick.org/stock/quote?region=HK&code=7226" \ -H "accept: application/json" \ -H "token: d267a8c7d18a4ba4b19c81225a2ffd3eae0e9ca3bd1a4bd9b969dfee99ee7acd" # Query the real-time quote for Kweichow Moutai on the Shanghai Stock Exchange curl -X GET "https://api.itick.org/stock/quote?region=SH&code=600519" \ -H "accept: application/json" \ -H "token: d267a8c7d18a4ba4b19c81225a2ffd3eae0e9ca3bd1a4bd9b969dfee99ee7acd"Technical Analysis
SKILL.mdembeds the same API token directly in two example commands. This exposes the credential to every person or system that can access the skill package, published artifact, cached copy, or repository history.The exposure contradicts the secure mechanism documented elsewhere in the same file, where authentication is performed using the
ITICK_API_TOKENenvironment variable. Secrets must not be placed in source files or documentation because access to those resources is commonly broader and less controlled than access to a secret manager.No proof that the token remains active was established during this static audit. Nevertheless, the value has the structure and placement of a real authentication credential and must be treated as compromised.
Attack Path
- An attacker obtains or views the published skill package.
- The attacker reads
SKILL.mdand extracts the token from line 384 or line 389. - The attacker places the token in the
tokenheader of requests tohttps://api.itick.org. - If the token remains active, the API attributes those requests to the token owner.
- The attacker consumes the associated quota or other API entitlements ...[truncated 736 chars]
- Remediation
View remediation
Remediation Suggestions
-
Revoke the exposed token immediately and issue a replacement. Do not assume that deleting the visible value is sufficient.
-
Replace both literal token headers with environment-variable references:
bash curl -X GET "https://api.itick.org/stock/quote?region=HK&code=7226" \ -H "accept: application/json" \ -H "token: $ITICK_API_TOKEN" curl -X GET "https://api.itick.org/stock/quote?region=SH&code=600519" \ -H "accept: application/json" \ -H "token: $ITICK_API_TOKEN" -
Remove the exposed value from repository history, release archives, package registries, caches, and other published artifacts where feasible.
-
Review API access logs for unexpected use of the compromised token and investigate anomalous source addresses, request volumes, and endpoints.
-
Store the replacement token only through the declared secret-management mechanism and prevent it from appearing in documentation, logs, examples, or error messages.
-
Apply least-privilege scopes, expiration, quota limits, and billing alerts to replacement credentials when supported by the provider.
-
Add automated secret scanning to pre-commit, CI, and package-publication workflows. Configure the pipeline to reject high-entropy credentials and known iTick token patterns.
-
