Back to skill

Security audit

password-gen

Security checks for vulnerabilities and agentic risk

Overview

The skill runs locally and shows no exfiltration behavior, but its passphrase mode can generate weak passwords while presenting them as secure.

Review this skill before installing. It appears local and non-exfiltrating, but do not rely on --passphrase for real accounts, encryption, or recovery secrets unless the word list and entropy model are fixed; use a password manager or a vetted Diceware-style generator instead.

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

Error
Location
scripts/password-gen.sh:36
Finding

Passphrases Generated from a Severely Undersized Fixed Dictionary

Content
View full analysis

Vulnerability Details

File Location: scripts/password-gen.sh, lines 36-40
Vulnerability Type: Weak credential generation
Risk Level: High

bash
WORDS="apple banana cherry dragon eagle forest grape honey island jungle kiwi lemon mango night ocean peach queen river silver tiger umbrella violet water yellow zebra"
PHRASE=$(echo "$WORDS" | tr ' ' '\n' | shuf -n "$LEN" | tr '\n' '-')
echo "🔑 密码短语:${PHRASE%-}"
echo "(由 $LEN 个常见单词组成,易记难破)"

Technical Analysis

Passphrases are selected from a fixed, publicly visible dictionary containing only 25 words. Because shuf -n samples without replacement, a default four-word passphrase has only:

log2(25 × 24 × 23 × 22) ≈ 18.6 bits

This represents approximately 303,600 possible ordered four-word passphrases, which is far below an acceptable security level for passwords intended to resist offline or sustained online guessing.

The implementation also accepts arbitrary numeric values without enforcing a secure minimum. Requests exceeding 25 words silently produce no more than 25 words because the dictionary contains only 25 unique entries. Consequently, the generated output can differ from the requested length.

The script presents these phrases as difficult to crack, and the associated documentation describes the generator as producing high-strength passwords. These claims may cause users to rely on low-entropy credentials for sensitive authentication or encryption.

Attack Path

  1. An attacker determines or suspects that a target used this Skill's passphrase mode.
  2. The attacker extracts the 25-word dictionary from the publicly available script.
  3. The attacker generates all ordered combinations for the likely requested word count. For the documented four-word mode, there are approximately 303,600 candidates.
  4. The attacker tests the candidates against an authentication endpoint, captured password hash, encrypted archive, or othe ...[truncated 759 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace the embedded 25-word dictionary with a vetted Diceware-style list containing at least 7,776 uniformly selectable entries.
  • Generate at least six independently selected words for security-sensitive use. Six selections from a 7,776-word list provide approximately 77.5 bits of entropy.
  • Select each word independently from cryptographically secure random bytes obtained from /dev/urandom; repeated words should be permitted because independent sampling preserves the intended entropy model.
  • Avoid modulo bias when converting random bytes to dictionary indexes. Use rejection sampling or a well-reviewed password-generation library.
  • Enforce a secure minimum word count and a reasonable maximum. Reject invalid or unsupported values with a nonzero exit status rather than silently changing the output.
  • Verify that the generated phrase contains exactly the requested number of words.
  • Document the approximate entropy associated with each supported word count and remove unsupported claims that the existing short phrases are difficult to crack.
  • Add automated tests for minimum length validation, exact word count, dictionary membership, invalid arguments, and behavior at boundary values.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description and the entire markdown content are written in Chinese, with no indication that other languages are supported or that the language choice is optional. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This shell script's description, usage comments, and output strings are written only in Chinese, which imposes a specific language on users without opt-in or an alternative locale. The policy explicitly treats forced language or locale as a natural-language policy violation unless the skill offers a choice or clearly documents a justified regional constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.