Back to skill

Security audit

Secure Password Generator

Security checks for vulnerabilities and agentic risk

Overview

This local password generator has no hidden network or persistence behavior, but it needs review because it can misstate credential strength and generate empty secrets with invalid inputs.

Review this skill before relying on it for real credentials. Its default password generation uses Python's secrets module and stays local, but do not rely on its entropy display or passphrase strength claims until corrected, and avoid zero, negative, or very large numeric arguments.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/passgen.py:100
Finding

Entropy Estimates Include Deterministic Characters and Overstate Credential Strength

Content
View full analysis
0 else 0 ``` ```python if args.entropy: ent = calc_entropy(result, charset) print(f"{result} (entropy: {ent:.1f} bits)") ``` ### Technical Analysis The entropy calculation assumes that every character in the final output is an independent, uniformly random choice from the specified character set. That assumption is valid for ordinary passwords and PINs generated character by character, but it is invalid for several supported output types. For passphrases, randomness comes from each selected word, not from each character in the resulting phrase. Word lengths and separators do not add entropy. The correct estimate is: ```text word_count × log2(number_of_words_in_wordlist) ``` For API keys, the fixed prefix and underscore are deterministic. Only the 32 random bytes generated by `secrets.token_hex(32)` contribute entropy, giving exactly 256 bits. The current calculation includes the fixed prefix and separator and therefore reports more than 256 bits for the default key. For URL-safe base64, 32 random bytes contain exactly 256 bits. The output has 43 unpadded base64 characters, and the current calculation reports `43 × 6 = 258` bits even though encoding cannot increase the source entropy. Consequently, the `--entropy` output can misrepresent the actual security strength of generated credentials. The passphrase entropy claim in `SKILL.md` is affected by the same conceptual issue. ### Attack Path 1. A user or automated system invokes the generator with `--entropy`, such as: ```bash python3 scripts/passgen.py --type passphrase --words 5 --entropy ``` ...[truncated 1259 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/passgen.py:106
Finding

Unvalidated Numeric Parameters Permit Empty Credentials and Resource Exhaustion

Content
View full analysis
?" return ''.join(secrets.choice(chars) for _ in range(length)) def gen_passphrase(words=5, separator="-"): return separator.join(secrets.choice(WORDLIST) for _ in range(words)) ``` ### Technical Analysis The command-line parser accepts zero, negative, and arbitrarily large integers for `--length`, `--words`, and `--count`. Python's `range()` is empty for zero or negative limits. As a result: - `--length 0` or a negative length produces an empty password, PIN, hex value, or base64 value. - `--words 0` or a negative word count produces an empty passphrase. - `--count 0` or a negative count exits successfully without producing any credential. The program does not emit an error or return a failure status for these invalid security parameters. This can allow automation to mistake ...[truncated 2161 chars]
Remediation
View remediation
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