T09 · Insecure Skill Coding Practices
- Location
config.json:2- Finding
Hardcoded SmartLib Gateway Bearer Secret
- Content
View full analysis
Vulnerability Details
File Location:
config.json, lines 2–3
Vulnerability Type: Hardcoded authentication credential
Risk Level: HighVulnerable Code
json { "SMARTLIB_GATEWAY_URL": "https://1318491188-jvmi3wist0.ap-shanghai.tencentscf.com", "SMARTLIB_GATEWAY_SECRET": "sk-O9vHwWzMg0Jf7khvhKQ0xxpdGIOROcw5RyQnROrNuZj9x6hOeHmi2", "SMARTLIB_EMAIL": null }Technical Analysis
The project distributes a plaintext bearer credential in
config.json.SKILL.mdinstructs the Agent to read this value and place it in theAuthorization: Bearerheader when calling protected SmartLib Gateway operations, including/quota,/consume, and/search.Because the credential is included in the Skill package, anyone who can download, inspect, copy, or redistribute the project can recover it without authentication. Bearer credentials grant access based on possession, so disclosure enables an external party to authenticate as the Skill until the credential is revoked or rotated.
This is a concrete credential-exposure vulnerability rather than evidence of credential theft or malicious intent by the project.
Attack Path
- An attacker obtains a copy of the distributed Skill package.
- The attacker opens
config.jsonand extractsSMARTLIB_GATEWAY_URLandSMARTLIB_GATEWAY_SECRET. - The attacker constructs requests to the configured Gateway using the exposed value in an
Authorization: Bearerheader. - The attacker invokes protected operations available to that shared credential, such as obtaining consumption tokens and submitting gateway search requests.
- The unauthorized access remains possible until the shared secret is revoked, rotated, or otherwise rejected by the service.
Impact Assessment
The exposed credential crosses the trust boundary between the SmartLib service operator and all recipients of the Skill package. An unauthorized party may impersonate the Skill when ac ...[truncated 400 chars]
- Remediation
View remediation
Remediation Suggestions
- Revoke and rotate the exposed Gateway secret immediately.
- Remove the populated
config.jsonfrom the distributed package and version-control history. - Distribute only
config.example.jsoncontaining nonfunctional placeholders. - Load the credential at runtime from a protected environment variable, operating-system credential store, or managed secrets service.
- Replace the shared package-wide bearer secret with per-user or per-installation credentials that are narrowly scoped, independently revocable, and short-lived where possible.
- Restrict Gateway authorization to only the endpoints and actions required by this Skill.
- Add automated secret scanning to release and CI workflows to prevent populated credentials from being packaged again.
- Review Gateway access logs for unauthorized use of the disclosed credential and invalidate outstanding sessions or derived tokens where supported.
