T09 · Insecure Skill Coding Practices
- Location
scripts/setup.sh:82- Finding
Python Code Injection Through Business Profile Fields
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This legal-document skill matches its stated purpose, but its scripts can expose sensitive local files or run unintended code from crafted input, so it needs review before installation.
Do not install this version without review or patching. Avoid entering EIN or other sensitive identifiers unless required, do not scan untrusted files or arbitrary paths, and treat generated profiles, contracts, reviews, and dashboard records as local sensitive files that may also enter your AI provider's conversation context.
scripts/setup.sh:82Python Code Injection Through Business Profile Fields
scripts/contract-scan.sh:77Python Code Injection Through a Crafted PDF Filename
scripts/contract-scan.sh:51Arbitrary Local-File Disclosure Through Contract Scanning
scripts/export-doc.sh:101Path Traversal Permits Export of Files Outside the Document Directory
scripts/contract-scan.sh:145Untrusted Contract Content Is Exposed to the Agent Without a Prompt-Injection Boundary
The README states that the skill remembers business details including name, address, EIN, and standard terms, but it does not pair this with any clear warning about local storage, access controls, retention, or sensitivity of that data. In a legal-document context, storing business identifiers and profile data without explicit handling guidance can lead to unintentional exposure through shared workstations, backups, logs, or insecure configuration files.
The setup guide instructs users to enter and persist sensitive business information, including EIN, address, owner identity, and contact details, into a local settings file without any warning about local storage, access controls, backup exposure, or sharing risks. In a skill context, this increases the chance that users unknowingly place regulated or sensitive data into a workspace that may be readable by other tools, copied into exports, or exposed through support/debug workflows.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
brew install pandoc
sudo apt install pandoc
Markdown export works out of the box — no extra tools needed.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
The user must run setup.sh before first use. This creates the data directory and business profile:
chmod 700 scripts/setup.sh && bash scripts/setup.sh
Business profile is stored in config/settings.json. The agent reads this file at the start of every document generation or review session.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
The user must run setup.sh before first use. This creates the data directory and business profile:
chmod 700 scripts/setup.sh && bash scripts/setup.sh
Business profile is stored in config/settings.json. The agent reads this file at the start of every document generation or review session.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
The user must run setup.sh before first use. This creates the data directory and business profile:
chmod 700 scripts/setup.sh && bash scripts/setup.sh
Business profile is stored in config/settings.json. The agent reads this file at the start of every document generation or review session.
The skill instructs storing a detailed business profile in config/settings.json, including highly sensitive fields like EIN, address, owner contact details, and contract defaults, and reusing it automatically across tasks. Without explicit consent, minimization, access control, retention guidance, or warnings about local plaintext storage, this creates a real privacy and data-exposure risk if the host, workspace, backups, or logs are accessed by others.
The skill says that when the user provides new business details in conversation, the agent should update config/settings.json and confirm changes, but it does not require explicit consent to persist those details. This creates a meaningful risk of silently retaining sensitive business or personal information that the user may have intended only for the current conversation.
The instructions create a data retention mechanism where missing fields are collected once, saved, and reused indefinitely going forward. That persistence expands the blast radius of any accidental disclosure, compromise, or misuse because sensitive information accumulates over time beyond the immediate task need.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
### Auto-Population
Every generated document MUST pull from the business profile. Never ask the user to re-enter information that exists in their profile. If a field is needed but missing, ask once, save it to the profile, and use it going forward.
---
Subtle instructions detected that may alter agent decision-making or introduce hidden biases.
### Review Rules
- Always note: "Consult an attorney for complex or high-value agreements"
- Never tell the user a contract is "safe" in absolute terms — use "appears standard" or "no unusual provisions identified"
- If the contract involves real estate, employment disputes, or amounts over $25,000, strongly recommend attorney review regardless of risk score
- Flag any clause that creates personal liability for a business owner (piercing the corporate veil risk)
- Flag any automatic renewal or evergreen clauses
The spec directs the agent to persist legal documents, contract reviews, file paths, parties, values, and renewal data locally and expose them through dashboard views, but it does not mention any user consent, access controls, retention limits, redaction, or warning that sensitive legal data will be stored and displayed. In the context of legal workflows, this creates a meaningful confidentiality and privacy risk because highly sensitive contract content and metadata may be retained or surfaced to unintended local users or dashboard viewers.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sys.exit(1)
" 2>/dev/null) || {
echo "Error: Cannot extract text from PDF." >&2
echo "Install poppler: brew install poppler (macOS) or sudo apt install poppler-utils (Linux)" >&2
exit 1
}
else
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sys.exit(1)
" 2>/dev/null) || {
echo "Error: Cannot extract text from PDF." >&2
echo "Install poppler: brew install poppler (macOS) or sudo apt install poppler-utils (Linux)" >&2
exit 1
}
else
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sys.exit(1)
" 2>/dev/null) || {
echo "Error: Cannot extract text from PDF." >&2
echo "Install poppler: brew install poppler (macOS) or sudo apt install poppler-utils (Linux)" >&2
exit 1
}
else
When --save is used, the script writes a copy of the full contract into a local reviews directory without any sensitivity warning, access control checks, or retention safeguards. This increases the risk of inadvertent data persistence, backup propagation, and unauthorized access by other local users or tools that scan the workspace.
The script prints the full contract contents to stdout for downstream agent review, which can expose sensitive legal, financial, or personal data in terminal history, logs, agent transcripts, or other telemetry. In an agent skill context this is more dangerous because stdout is often captured automatically and may be sent to remote systems or retained longer than the user expects.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
mkdir -p "$DATA_DIR/exports"
# Set permissions on sensitive directories
chmod 700 "$CONFIG_DIR"
chmod 700 "$DATA_DIR"
echo "✓ Data directories created"
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
mkdir -p "$DATA_DIR/exports"
# Set permissions on sensitive directories
chmod 700 "$CONFIG_DIR"
chmod 700 "$DATA_DIR"
echo "✓ Data directories created"
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
mkdir -p "$DATA_DIR/exports"
# Set permissions on sensitive directories
chmod 700 "$CONFIG_DIR"
chmod 700 "$DATA_DIR"
echo "✓ Data directories created"
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
mkdir -p "$DATA_DIR/exports"
# Set permissions on sensitive directories
chmod 700 "$CONFIG_DIR"
chmod 700 "$DATA_DIR"
echo "✓ Data directories created"
The script interactively collects sensitive business and personal data, including address, EIN, signatory name, email, and phone number, and writes it to a persistent JSON file on disk without clearly warning the user beforehand that this information will be stored locally. In a setup flow for a legal-document skill, that increases privacy risk because users may disclose regulated or sensitive business information under the assumption it is only used transiently.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
json.dump(settings, f, indent=2)
"
chmod 600 "$SETTINGS_FILE"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━"
The example invocation "Review this contract" is very broad and does not define scope, constraints, or exclusion conditions. In a skill README, this can make activation boundaries unclear because it resembles a generic everyday request rather than a narrowly scoped trigger.
Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.
## Recommendations
1. **File permissions:** Run `chmod 700 config/` to restrict access to your business profile
2. **Backup:** Keep copies of important generated documents outside the skill directory
3. **Sensitive contracts:** For highly confidential agreements (M&A, litigation-related), consider whether AI-assisted review is appropriate for your situation
4. **Regular review:** Periodically review `config/settings.json` to ensure it contains only information you intend to store
No suspicious patterns detected.