T09 · Insecure Skill Coding Practices
- Location
scripts/setup.sh:12- Finding
Plaintext LinkedIn Credentials and Insufficient File Permission Hardening
- Content
View full analysis
Vulnerability Details
File Locations:
SKILL.md:23-29scripts/setup.sh:12-18scripts/setup.sh:24-44scripts/setup.sh:53-68
Vulnerability Type: Plaintext sensitive-data storage and insecure filesystem permissions
Risk Level: MediumVulnerable Code
SKILL.md:23-29instructs users to store reusable LinkedIn credentials in a plaintext environment file:bash 3. Store LinkedIn credentials in `~/.clawdbot/secrets.env`: ```bash LINKEDIN_EMAIL=your-email@example.com LINKEDIN_PASSWORD=your-password ``` 4. Test with: `scripts/engage.sh --dry-run`scripts/setup.sh:12-18creates the configuration directory and configuration file without explicitly enforcing restrictive permissions:bash # Create config directory mkdir -p "$CONFIG_DIR" echo "✓ Created $CONFIG_DIR" # Copy example config if none exists if [ ! -f "$CONFIG_DIR/config.json" ]; then cp "$SKILL_DIR/config.example.json" "$CONFIG_DIR/config.json"scripts/setup.sh:24-44creates state files using ordinary shell redirection, leaving their permissions dependent on the invoking process'sumask:bash # Initialize data files for file in posts-queue.json engagement-history.json dm-sequences.json connections.json analytics.json activity-log.json; do if [ ! -f "$CONFIG_DIR/$file" ]; then case "$file" in posts-queue.json) echo '{"posts":[]}' > "$CONFIG_DIR/$file" ;; engagement-history.json) echo '{"engagements":{}}' > "$CONFIG_DIR/$file" ;; dm-sequences.json) echo '{"sequences":{}}' > "$CONFIG_DIR/$file" ;; connections.json) echo '{"connections":{}}' > "$CONFIG_DIR/$file" ;; analytics.json) echo '{"history":[]}' > "$CONFIG_DIR/$file" ;; activity-log.json) echo '[]' > "$CONFIG_DIR/$file" ;;`scripts/setup.sh: ...[truncated 3365 chars]
- Remediation
View remediation
Remediation Suggestions
- Prefer an operating-system keychain, credential manager, or supported secret-management service instead of storing a reusable LinkedIn password in a plaintext file.
- Where file-based secrets are unavoidable, set a restrictive process mask before creating any files:
bash umask 077 - Create and repair directory permissions explicitly:
bash install -d -m 700 "$CONFIG_DIR" - Create configuration and state files with mode
0600, usinginstall, securely created temporary files, and atomic replacement where updates are required. - Validate that
~/.clawdbot/secrets.envis owned by the current user, is a regular file rather than a symbolic link, and has no group or other permissions. Refuse to continue until unsafe permissions are corrected. - Apply equivalent ownership, regular-file, and symbolic-link checks to the configuration directory and all state files before reading or writing them.
- Avoid recording passwords, session tokens, complete private messages, or other unnecessary sensitive content in activity logs.
- Update
SKILL.mdto document the required permissions and recommend session-based authentication or a secret manager as the primary authentication method.
