T09 · Insecure Skill Coding Practices
- Location
scripts/tasks.py:24- Finding
Unvalidated API Port Allows Request Redirection and Bearer Token Disclosure
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly purpose-aligned, but it can modify/delete Obsidian task data and has a concrete URL construction flaw that could leak the TaskNotes API token if its environment settings are tampered with.
Review this before installing if your Obsidian tasks contain sensitive information. Use a trusted vault .env, keep TASKNOTES_API_PORT as a simple numeric localhost port, set a limited TaskNotes token if possible, and avoid letting an agent delete tasks without explicit confirmation.
scripts/tasks.py:24Unvalidated API Port Allows Request Redirection and Bearer Token Disclosure
scripts/tasks.py:2Unpinned Runtime Dependencies Create a Supply-Chain Integrity Risk
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
import requests
from dotenv import load_dotenv
# Load .env from vault root
SCRIPT_DIR = Path(__file__).parent
VAULT_ROOT = SCRIPT_DIR.parent.parent.parent.parent
load_dotenv(VAULT_ROOT / ".env")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Load .env from vault root
SCRIPT_DIR = Path(__file__).parent
VAULT_ROOT = SCRIPT_DIR.parent.parent.parent.parent
load_dotenv(VAULT_ROOT / ".env")
API_KEY = os.getenv("TASKNOTES_API_KEY")
API_PORT = os.getenv("TASKNOTES_API_PORT", "8080")
The skill documents use of environment variables and localhost network access but does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity where an agent may invoke code, read env-backed secrets, or access local HTTP services without clear user-visible constraints.
The skill exposes a delete operation for task files but provides no warning, safeguard, or confirmation requirement. Because this action permanently removes task data from the user's Obsidian vault via the plugin API, accidental or mis-triggered use can cause irreversible data loss.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
## When to Use
- "create a task for X" → create task
- "show my tasks" → list all tasks
- "show in-progress tasks" → list --status in-progress
- "mark X as done" → update task status to done
The trigger phrases are broad and conversational, such as 'show my tasks' and 'what should I work on,' which can cause the skill to activate in situations where the user did not explicitly intend TaskNotes operations. In an agent setting, overbroad invocation increases the chance of unintended reads or task modifications, especially when paired with update and delete capabilities.
The delete command issues a DELETE request for a task, which is a destructive operation, but the code provides no confirmation prompt before executing it. The surrounding help text and docstrings also do not warn that this action removes task data.
No suspicious patterns detected.