Back to skill

Security audit

Text

Security checks for vulnerabilities and agentic risk

Overview

This text-processing skill is mostly ordinary reference guidance, but it includes an unsafe command that can print complete .env secrets without warning or redaction.

Review this skill before installing if it may be used on projects containing secrets. Avoid running guidance that prints .env contents; prefer listing variable names or redacted values, and make backups before using in-place editing commands.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
data.md:225
Finding

Sensitive Environment Variable Disclosure

Content
View full analysis

Vulnerability Details

File Location: data.md:225-226
Vulnerability Type: Sensitive data exposure through unsafe .env inspection
Risk Level: Medium

Vulnerable Code

bash
# .env files
grep -v '^#' .env | grep '='

Technical Analysis

The documented command prints every non-comment line in the .env file containing an equals sign. Environment files commonly store plaintext API keys, access tokens, database credentials, passwords, and other sensitive configuration values.

The command does not redact values, restrict output to variable names, obtain explicit authorization, or distinguish secrets from non-sensitive configuration. If an agent follows this guidance, complete secret values may be copied into terminal output, agent context, execution logs, conversation transcripts, or subsequent responses.

No external transmission mechanism was identified in the project. Therefore, this is an insecure secret-handling practice rather than confirmed intentional exfiltration.

Attack Path

  1. A user asks the agent to inspect, parse, summarize, or troubleshoot project configuration.
  2. The agent loads and follows the guidance in data.md.
  3. The agent executes grep -v '^#' .env | grep '=' in a project containing an .env file.
  4. All matching assignments, including secret values, are printed to standard output.
  5. The resulting secrets enter the agent's context, terminal logs, transcripts, or generated response.
  6. Anyone with access to those outputs may recover and misuse the exposed credentials.

Impact Assessment

The command itself does not grant additional operating-system privileges. The scope of potential compromise depends on the credentials stored in .env. Exposed values could permit unauthorized access to databases, cloud services, third-party APIs, internal services, or administrative interfaces under the privileges associated with those credentials.

The immediate exposure scope includes the command output, ag ...[truncated 223 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove guidance that prints complete .env assignments.
  • Require explicit user authorization before accessing files likely to contain credentials.
  • Enumerate variable names without exposing their values:
bash
sed -nE 's/^[[:space:]]*(export[[:space:]]+)?([A-Za-z_][A-Za-z0-9_]*)=.*/\2/p' .env
  • If values must be validated, process them locally and emit only validation status or redacted forms.
  • Redact sensitive values before including output in logs, transcripts, diagnostics, or model responses.
  • Apply restrictive permissions to environment files, such as owner-only access where appropriate.
  • Prefer a dedicated secret manager over plaintext .env storage for production credentials.
  • Add an explicit warning that .env contents must never be displayed or copied into conversational output.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (5)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · data.md (reported line 225)May include surrounding context.

YAML - ALWAYS use yq

yq '.database.host' config.yaml

.env files

grep -v '^#' .env | grep '='

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · data.md (reported line 226)May include surrounding context.

YAML - ALWAYS use yq

yq '.database.host' config.yaml

.env files

grep -v '^#' .env | grep '='

text

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The markdown includes the instruction "Avoid - First person (unless discipline allows)," which prescribes a specific writing convention as a default. Because this is natural-language guidance that constrains style without offering the user an explicit choice, it can be read as forcing a particular language/register policy beyond cases where it is necessary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown includes a sed -i command that directly modifies file.csv in place, which can overwrite user data irreversibly if run on the wrong file or without a backup. The surrounding documentation does not warn that this command changes the file on disk rather than printing transformed output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

Line L138 instructs that if only one Spanish variant is available, the skill should default to a specific 'neutral' form using 'ustedes'. This imposes a locale/register choice by default rather than offering user selection or explicit opt-in, which can conflict with language/locale policy expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.