T09 · Insecure Skill Coding Practices
- Location
references/privacy-checklist.md:12- Finding
Privacy Scan May Disclose Complete Credential-Bearing Lines
- Content
View full analysis
Vulnerability Details
File Location:
references/privacy-checklist.md, lines 12–14
Vulnerability Type: Sensitive information exposure through unredacted scan output
Risk Level: MediumVulnerable Code:
powershell Get-ChildItem . -Recurse -File | Select-String -Pattern 'apiKey|token|secret|password' -CaseSensitive:$falseTechnical Analysis
The documented PowerShell command recursively searches project files for credential-related terms. By default,
Select-Stringoutputs each complete matching line, including its contents. If a line contains an actual API key, token, secret, or password, the command can reveal the sensitive value instead of merely identifying the affected file.Because this skill requires execution evidence for multi-step tasks, raw command results could subsequently enter agent context, terminal transcripts, task logs, or completion artifacts. The scan is recursive and does not exclude credential stores, generated files, or other sensitive locations under the working directory.
Attack Path
- A project file contains a plaintext credential on a line that includes
apiKey,token,secret, orpassword. - A user or agent follows the privacy checklist and executes the documented recursive scan.
Select-Stringprints the complete matching line, including the credential value.- The output is retained in terminal history, agent context, logs, or completion evidence.
- A party with access to those records can recover and misuse the exposed credential.
Impact Assessment
The command does not itself grant elevated system privileges or transmit data over a network. Its direct impact is local disclosure of any secrets discoverable beneath the scanned directory. The effective privileges and scope available to an attacker depend on the exposed credential and may include access to associated APIs, services, repositories, or accounts. The audit found no automatic exf ...[truncated 20 chars]
- A project file contains a plaintext credential on a line that includes
- Remediation
View remediation
Remediation Suggestions
- Do not print complete matching lines. Emit only file paths and line numbers, or explicitly redact matched values before displaying results.
- Use a scanner designed for secret detection that masks values by default.
- Exclude known credential stores, generated output, version-control metadata, and other sensitive directories from recursive scans.
- Do not copy raw secret-scan output into agent responses, logs, completion evidence, or persistent artifacts.
- Restrict access to scan logs and remove any existing records that contain credentials.
- If a credential has already appeared in output, revoke or rotate it and review relevant service logs for misuse.
