T09 · Insecure Skill Coding Practices
- Location
scripts/validate_env.py:209- Finding
Generated schemas store sensitive environment values in plaintext
- Content
View full analysis
Vulnerability Details
File Location:
scripts/validate_env.py:209-213
Vulnerability Type: Plaintext disclosure of sensitive configuration values
Risk Level: HighVulnerable Code
python var_def = { 'type': var_type, 'required': True, } if value: var_def['example'] = value if any(s in key.upper() for s in ['SECRET', 'PASSWORD', 'KEY', 'TOKEN', 'API_KEY']): var_def['sensitive'] = True schema['variables'][key] = var_defTechnical Analysis
Schema generation copies every nonempty environment value into the schema's
examplefield. This occurs before or independently of the sensitive-key classification. SettingsensitivetoTrueonly adds metadata and does not redact, omit, or encrypt the value.Consequently, variables such as
DATABASE_PASSWORD,API_KEY,ACCESS_TOKEN, and connection strings containing credentials are written verbatim to generated schema output. The documented workflow inSKILL.mdadvises users to generate a schema from a working.envfile and add that schema to a repository, making accidental credential publication a realistic outcome.Attack Path
- A working
.envfile contains active passwords, API keys, tokens, or credential-bearing connection strings. - The user follows the documented workflow and runs:
bash python3 scripts/validate_env.py --generate-schema .env -o env-schema.json generate_schema()copies each populated value into the correspondingexampleproperty.- The generated schema is committed to source control, uploaded as a CI artifact, or shared with another party.
- Anyone able to access that artifact can recover the credentials in plaintext and use them against the associated services.
Impact Assessment
This issue compromises the confidentiality of every populated value in the input
.envfile. An attacker does not gain local privilege escalation through the validator itse ...[truncated 429 chars]- A working
- Remediation
View remediation
Remediation Suggestions
- Never copy the value of a sensitive variable into an auto-generated schema.
- Determine sensitivity before assigning the
examplefield and omit that field for sensitive variables:python sensitive = any( marker in key.upper() for marker in ['SECRET', 'PASSWORD', 'KEY', 'TOKEN', 'API_KEY'] ) var_def['sensitive'] = sensitive if value and not sensitive: var_def['example'] = value - Prefer neutral placeholders such as
REDACTEDoryour-secret-hereonly if an example is required. - Expand sensitive-key detection to cover common names such as
CREDENTIAL,PRIVATE,AUTH, and credential-bearing connection strings. - Display a warning that generated schema files must be reviewed before being committed or shared.
- Document that schemas should be generated from sanitized template files such as
.env.example, not production.envfiles. - Add tests confirming that generated schema output never contains known secret fixture values.
- If affected schemas have already been published, remove them from repository history and artifact storage, then rotate all exposed credentials.
