T09 · Insecure Skill Coding Practices
- Location
scripts/context_manager.py:21- Finding
Conversation Data Stored in an Unprotected Plaintext File
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a small manual CLI for saving chat context locally, with real privacy caveats but no evidence of hidden, remote, or malicious behavior.
Install only if you are comfortable with chat history being stored locally in plaintext under the skill directory. Avoid storing secrets or sensitive customer data, and be careful with list and clear because list exposes all saved contexts and clear with no channel removes them all.
scripts/context_manager.py:21Conversation Data Stored in an Unprotected Plaintext File
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
Retrieve context:
python3 scripts/context_manager.py retrieve --channel "telegram-123" --user "user-456"
Clear context:
python3 scripts/context_manager.py clear --channel "telegram-123"
List all contexts:
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
Retrieve context:
python3 scripts/context_manager.py retrieve --channel "telegram-123" --user "user-456"
Clear context:
python3 scripts/context_manager.py clear --channel "telegram-123"
List all contexts:
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
Retrieve context:
python3 scripts/context_manager.py retrieve --channel "telegram-123" --user "user-456"
Clear context:
python3 scripts/context_manager.py clear --channel "telegram-123"
List all contexts:
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
#!/usr/bin/env python3
"""
Multi-Chat Context Manager
Store, retrieve, and clear conversation contexts per channel/user.
"""
import json
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
#!/usr/bin/env python3
"""
Multi-Chat Context Manager
Store, retrieve, and clear conversation contexts per channel/user.
"""
import json
The skill advertises executable capabilities via Python and describes file-backed context storage, but it does not declare any explicit tool scope such as permissions or allowed-tools. That mismatch increases the risk of overbroad execution in hosts that rely on manifest scoping, especially because the skill can read/write plaintext context data and invoke a shell command.
The tool persists full conversation content, including user messages and agent responses, to a local JSON file without any notice, consent flow, or sensitivity controls. In a chat-context skill, stored data is likely to include secrets, personal data, or proprietary information, so silent persistence increases confidentiality and privacy risk if the host is shared, backed up, or later accessed by other processes or users.
Calling clear with no channel causes the program to erase all stored contexts, yet the CLI does not require confirmation or a force flag before performing this destructive action. In a context-management tool, this can lead to accidental mass deletion of conversation history and operational disruption, especially in scripts or multi-user workflows.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def test_cli():
"""Test command-line interface."""
# Test store via subprocess
result = subprocess.run([
sys.executable,
os.path.join(os.path.dirname(__file__), '..', 'scripts', 'context_manager.py'),
'store',
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print("✓ CLI store passed")
# Test retrieve
result = subprocess.run([
sys.executable,
os.path.join(os.path.dirname(__file__), '..', 'scripts', 'context_manager.py'),
'retrieve',
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print("✓ CLI retrieve passed")
# Clean up
subprocess.run([
sys.executable,
os.path.join(os.path.dirname(__file__), '..', 'scripts', 'context_manager.py'),
'clear',
No suspicious patterns detected.