T09 · Insecure Skill Coding Practices
- Location
scripts/configure_delivery.py:56- Finding
SMTP Credentials Are Exposed Through Command-Line Arguments and Stored in Plaintext
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill matches its stated final-message purpose, but it handles highly sensitive emails, credentials, and automatic delivery in ways users should review carefully before installing.
Install only if you are comfortable with a local scheduled process storing final messages, audio, recipient details, and SMTP credentials, and sending email automatically. Before using it with real recipients, avoid entering SMTP secrets in chat or command arguments, disable debug mode after testing, verify warning emails go to you rather than the final recipient, and check that stored audio and credentials are actually removed when resetting.
scripts/configure_delivery.py:56SMTP Credentials Are Exposed Through Command-Line Arguments and Stored in Plaintext
scripts/check_activity.py:240Final Messages Are Repeatedly Delivered After the Inactivity Threshold
scripts/check_activity.py:28Inactivity Warning Emails Are Sent to the Final-Message Recipient Instead of the User
scripts/database.py:226Reset Leaves Sensitive Audio and Persistent Debug State Behind
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cd last-words
cp .env.example .env
# 编辑 .env 文件填入配置
nano .env
Documenting a destructive reset capability without making it part of the declared purpose creates a hidden administrative function that can erase sensitive records. In a skill that stores final messages and delivery settings, undisclosed deletion functionality can cause irreversible loss of critical user data.
Documenting a destructive reset capability without making it part of the declared purpose creates a hidden administrative function that can erase sensitive records. In a skill that stores final messages and delivery settings, undisclosed deletion functionality can cause irreversible loss of critical user data.
Documenting a destructive reset capability without making it part of the declared purpose creates a hidden administrative function that can erase sensitive records. In a skill that stores final messages and delivery settings, undisclosed deletion functionality can cause irreversible loss of critical user data.
Documenting a destructive reset capability without making it part of the declared purpose creates a hidden administrative function that can erase sensitive records. In a skill that stores final messages and delivery settings, undisclosed deletion functionality can cause irreversible loss of critical user data.
The skill instructs the agent to collect a live SMTP authorization code in chat and then pass it on the command line to a script. This is dangerous because chat transcripts, process lists, shell history, logs, and downstream storage can all expose the credential, enabling account compromise and unauthorized email sending.
Debug mode can trigger immediate delivery of a user's final message, which is a highly sensitive and potentially irreversible action. Failing to present this as a prominent warning increases the risk of accidental emotional harm, privacy breaches, and unintended message release.
Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.
try:
if recorder == "arecord":
subprocess.run(["arecord", "-f", "cd", "-t", "wav", str(output)], check=True)
elif recorder == "rec":
subprocess.run(["rec", str(output)], check=True)
elif recorder == "ffmpeg":
Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.
if recorder == "arecord":
subprocess.run(["arecord", "-f", "cd", "-t", "wav", str(output)], check=True)
elif recorder == "rec":
subprocess.run(["rec", str(output)], check=True)
elif recorder == "ffmpeg":
subprocess.run(["ffmpeg", "-f", "alsa", "-i", "default", str(output)], check=True)
Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.
elif recorder == "rec":
subprocess.run(["rec", str(output)], check=True)
elif recorder == "ffmpeg":
subprocess.run(["ffmpeg", "-f", "alsa", "-i", "default", str(output)], check=True)
print(f"\n✓ Recording saved: {output}")
The function comment says warnings are sent to the user, but the implementation sends them to config['contact'], which is the final recipient. In this skill's context, that can prematurely reveal the existence of a planned posthumous/final message workflow to the loved one and leak sensitive metadata about the user's inactivity and recipient relationship.
The script enables a debug path that bypasses the 30-day inactivity safeguard and can deliver the final message immediately. In a skill specifically designed to release highly sensitive final communications, this defeats the core safety control and allows accidental, unauthorized, or abuse-triggered disclosure of deeply private content and attachments.
Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.
print("=" * 50)
if debug_mode:
print("\n🐛 DEBUG MODE ENABLED")
print(" Messages can be sent immediately without 30-day wait")
print("=" * 50)
Within debug mode, delivery proceeds immediately with no secondary confirmation, approval, or recipient preview. Because the message may contain intimate final words and audio attachments, a single mistaken flag or unauthorized invocation can cause irreversible disclosure to the configured contact.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Or use environment variables (recommended for security):
SMTP_USER, SMTP_PASS, CONTACT_EMAIL, SMTP_HOST, SMTP_PORT
Or create a .env file from .env.example
"""
import argparse
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Or use environment variables (recommended for security):
SMTP_USER, SMTP_PASS, CONTACT_EMAIL, SMTP_HOST, SMTP_PORT
Or create a .env file from .env.example
"""
import argparse
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Or use environment variables (recommended for security):
SMTP_USER, SMTP_PASS, CONTACT_EMAIL, SMTP_HOST, SMTP_PORT
Or create a .env file from .env.example
"""
import argparse
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Or use environment variables (recommended for security):
SMTP_USER, SMTP_PASS, CONTACT_EMAIL, SMTP_HOST, SMTP_PORT
Or create a .env file from .env.example
"""
import argparse
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Or use environment variables (recommended for security):
SMTP_USER, SMTP_PASS, CONTACT_EMAIL, SMTP_HOST, SMTP_PORT
Or create a .env file from .env.example
"""
import argparse
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Or use environment variables (recommended for security):
SMTP_USER, SMTP_PASS, CONTACT_EMAIL, SMTP_HOST, SMTP_PORT
Or create a .env file from .env.example
"""
import argparse
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env_file():
"""Load environment variables from .env file if it exists."""
env_path = Path(__file__).parent.parent / ".env"
if env_path.exists():
with open(env_path) as f:
for line in f:
Accepting SMTP credentials via command-line arguments is dangerous because process arguments are often exposed through shell history, process listings, job control systems, and audit logs. In the context of a tool handling highly sensitive final-message delivery, leakage of mailbox credentials could let an attacker read or send messages, alter delivery, or exfiltrate private data.
parser.add_argument("--smtp-user", help="SMTP username")
parser.add_argument("--smtp-pass", help="SMTP password")
parser.add_argument("--from-env", "-e", action="store_true",
help="Load configuration from environment variables or .env file")
args = parser.parse_args()
After loading configuration, the script prints the SMTP username and recipient contact to stdout. While it does not print the password, exposing account identifiers and recipient details can leak sensitive personal information into terminal scrollback, logs, CI output, or support captures; in this skill's context, the contact data is especially sensitive because it reveals intended recipients of posthumous messages.
smtp_user=env_config['smtp_user'],
smtp_pass=env_config['smtp_pass']
)
print(f"✓ Configuration loaded from environment/.env file")
print(f" SMTP User: {env_config['smtp_user']}")
print(f" Contact: {env_config['contact']}")
print(f" SMTP: {env_config['smtp_host']}:{env_config['smtp_port']}")
This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
When debug mode is enabled, messages can be sent immediately without waiting for 30 days.
Usage:
python3 debug_mode.py on # Enable debug mode
python3 debug_mode.py off # Disable debug mode
python3 debug_mode.py status # Check debug mode status
python3 debug_mode.py send # Immediate send in debug mode
This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
When debug mode is enabled, messages can be sent immediately without waiting for 30 days.
Usage:
python3 debug_mode.py on # Enable debug mode
python3 debug_mode.py off # Disable debug mode
python3 debug_mode.py status # Check debug mode status
python3 debug_mode.py send # Immediate send in debug mode