T09 · Insecure Skill Coding Practices
- Location
config.json:1- Finding
Plaintext API Credential Storage in Project Configuration
- Content
View full analysis
Vulnerability Details
File Location:
config.json:1-3; supporting instructions inREADME.md:9-15andSKILL.md:97-98
Vulnerability Type: Plaintext sensitive credential storage
Risk Level: MediumVulnerable Code
json { "api_key": "YOUR_API_KEY_HERE" }The current value is only a placeholder and is not an exposed working credential. However, the accompanying documentation explicitly directs users to replace it with a real API key and retain that key in this plaintext project file.
Technical Analysis
API keys are bearer credentials: possession is generally sufficient to authenticate requests. Storing a real key in a plaintext file inside the project directory makes it accessible to every process, user, agent, backup system, or repository operation that can read that directory.
The project contains no
.gitignoreentry, environment-variable integration, secret-store integration, or file-permission control protectingconfig.json. Consequently, after a user follows the documented setup procedure, the credential could be exposed through accidental source-control commits, shared workspaces, archived project copies, diagnostic bundles, logs that capture file contents, or unrelated tools with workspace read access.The Skill is designed to transmit the configured key to
https://dyinsight.cn/api/v1/skills/contract/audit. That transmission is declared and uses HTTPS; the finding concerns local plaintext persistence rather than an undisclosed network destination.Attack Path
- A user replaces
YOUR_API_KEY_HEREinconfig.jsonwith a valid API key as directed by the documentation. - The project directory is committed to source control, shared with another party, backed up insecurely, or accessed by another local tool or agent.
- An attacker obtains read access to
config.jsonand extracts the bearer credential. - The attacker submits requests to the documented contract-audit AP ...[truncated 746 chars]
- A user replaces
- Remediation
View remediation
Remediation Suggestions
- Remove support for storing real API keys directly in the project-tracked
config.json. - Load the credential from an environment variable such as
DYINSIGHT_API_KEY, or use an operating-system or platform-managed secret store. - Keep only a non-sensitive example file, such as
config.example.json, containing the placeholder value. - Add the real local configuration file to
.gitignoreand equivalent packaging or backup exclusion rules. - Apply restrictive filesystem permissions if a local secret file remains necessary, allowing access only to the account running the Skill.
- Ensure errors and diagnostic logs redact the key and never print request bodies containing it.
- Update
README.mdandSKILL.mdto describe secure secret provisioning rather than instructing users to place a real key in a project file. - Provide key revocation and rotation guidance. Any key previously committed, shared, or archived should be treated as compromised and replaced.
- Where supported by the service, issue narrowly scoped keys with rate limits, spending limits, expiration, and monitoring for anomalous use.
- Remove support for storing real API keys directly in the project-tracked
