T09 · Insecure Skill Coding Practices
- Location
config.json:3- Finding
Production Gateway Secret Embedded in Distributed Configuration
- Content
View full analysis
Vulnerability Details
File Location:
config.json:3
Vulnerability Type: Hard-coded production credential
Risk Level: HighVulnerable Code
json { "SMARTLIB_GATEWAY_URL": "https://1318491188-jvmi3wist0.ap-shanghai.tencentscf.com", "SMARTLIB_GATEWAY_SECRET": "[REDACTED EXPOSED sk- PREFIX SECRET]", "SMARTLIB_EMAIL": null, "SMARTLIB_APPID": null, "SMARTLIB_APPSECRET": null }The credential value is redacted in this report to avoid further disclosure. The audited file contains the complete plaintext secret.
Technical Analysis
The active configuration contains a plaintext, secret-like production gateway credential. This is not a sample value:
config.example.json:3uses the placeholder<your-gateway-secret>, demonstrating that the value inconfig.jsonis inconsistent with the intended configuration pattern.Any party able to download the Skill package or read its source can recover the credential without authentication. If the gateway accepts this value for authentication or authorization, it can be replayed outside the Skill. Storing the secret in JSON also exposes it to source-control history, package archives, backups, diagnostic collection, and other users with access to the installation.
Attack Path
- An attacker downloads or otherwise obtains the distributed Skill package.
- The attacker opens
config.jsonand extractsSMARTLIB_GATEWAY_SECRET. - The attacker identifies the associated endpoint from
SMARTLIB_GATEWAY_URL. - The attacker reproduces the gateway request format used by the related SmartLib integration.
- If the gateway accepts the exposed secret, the attacker submits authenticated requests independently of the Skill.
- The credential remains reusable until it is revoked or rotated.
Impact Assessment
Potential impact depends on the gateway permissions assigned to the secret. If valid, exposure may permit unauthorized gatewa ...[truncated 474 chars]
- Remediation
View remediation
Remediation Suggestions
- Revoke and rotate the exposed gateway secret immediately.
- Remove
config.jsoncontaining production values from the distributed package and source-control history. - Ship only
config.example.jsonwith placeholders. - Load secrets from environment variables, an operating-system credential store, or the platform's managed secret facility.
- Apply strict filesystem permissions to any locally generated configuration containing credentials.
- Configure narrowly scoped, per-installation credentials rather than a shared production secret.
- Add automated secret scanning to pre-commit and release pipelines.
- Review gateway logs for suspicious use of the exposed credential and invalidate related sessions or tokens where necessary.
