T09 · Insecure Skill Coding Practices
- Location
index.ts:67- Finding
AES Master Key Disclosed Through Application Logs
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a secret manager, but its implementation can expose the secrets and encryption key it claims to protect.
Review before installing. This skill handles highly sensitive values, but it can print its encryption key, import the whole process environment if invoked with a broad prefix, and return stored secrets to any caller that sets the documented flags. Use only in a tightly controlled environment after fixing key handling, environment import scoping, and real authorization for secret retrieval.
index.ts:67AES Master Key Disclosed Through Application Logs
index.ts:162Caller-Controlled Flags Permit Unauthenticated Plaintext Secret Disclosure
index.ts:224Arbitrary Prefix Allows Harvesting of the Entire Process Environment
When no key is provided, the skill generates an encryption key, writes it into the process environment, and logs the key value to the console. This exposes the master key to logs, terminals, subprocesses, and other components that can read environment variables, undermining all encryption performed by the skill.
The code emits the generated encryption key directly in console warnings without any safe handling or interface disclosure. Console output is frequently captured in logs or agent transcripts, so this can permanently leak the key and allow retrospective decryption of all stored secrets.
The entire skill description, parameters, and examples are presented only in Chinese, with no indication that users may choose another language or that the locale restriction is intentional. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.
The visible instructional content of the skill is written entirely in Chinese, including headings, parameter explanations, and examples. For a general-purpose skill, this imposes a specific language/locale on users without any opt-in or documented region-specific justification, which matches the language-policy violation criteria.
The skill claims permission control and leak prevention, but there is no real access-control boundary: any caller can request secret exposure by passing allowSecret=true or showSecrets=true. In a multi-tool or agent setting, such misleading claims are dangerous because operators may trust the skill to protect secrets when it does not.
The skill markets itself as secure secret management, but both get with allowSecret=true and list with showSecrets=true return decrypted plaintext secrets to any caller who sets those flags. There is no actual authorization or policy enforcement, so secrecy depends entirely on caller honesty, which defeats the claimed protection model and can directly leak credentials.
loadFromEnv bulk-reads all environment variables matching a prefix and imports them into the skill's store, potentially sweeping in sensitive system secrets without strong user awareness or consent boundaries. In agent environments, bulk environment access increases blast radius because a single call can ingest many secrets for later exposure through other weak interfaces.
The manifest describes environment variable and secret management, but set, get, list, and delete operate on envStore, an internal object, not the process environment. Aside from reading and writing the encryption key env var and importing existing env vars, the code does not actually manage environment variables in the runtime environment as the description implies.