Back to skill

Security audit

homebase

Security checks for vulnerabilities and agentic risk

Overview

This household skill is mostly coherent and disclosed, but it deserves review because one exposed tool can write all queued school email-derived events to Google Calendar without a technical approval check.

Review before installing. Only use this skill if you are comfortable granting the gog integration access to Gmail and Google Calendar and storing family PII locally. Keep config.json private, and do not let automated runners call confirm_pending_school_events unless they have verified an explicit family approval for the exact pending events.

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

T09 · Insecure Skill Coding Practices

Warning
Location
tools.py:739
Finding

Calendar event creation does not technically enforce family approval

Content
View full analysis

Vulnerability Details

File Location: tools.py:739-779
Vulnerability Type: Missing authorization enforcement for externally derived calendar changes
Risk Level: Medium

Complete Code Snippet

python
def confirm_pending_school_events(email_id: str = "") -> str:
    """
    Create calendar events for a pending entry and clear it.
    If email_id is empty, confirms ALL pending entries (for "add all" replies).
    Returns a summary string with per-event results.
    """
    from features.calendar.calendar_manager import create_event
    data = _load_pending_school_events()
    data = _purge_stale_pending(data)
    if not data:
        return "🤔 No pending school events to confirm."

    targets = [email_id] if email_id else list(data.keys())
    if email_id and email_id not in data:
        return f"🤔 No pending events for email {email_id}."

    created = []
    failed = []
    for eid in targets:
        entry = data.get(eid)
        if not entry:
            continue
        for ev in entry.get("events", []):
            title = ev["title"]
            date = ev["date"]
            time_str = ev.get("time") or None
            try:
                create_event(
                    title=title,
                    date_str=date,
                    time_str=time_str,
                    duration_minutes=60,
                    is_all_day=(time_str is None),
                )
                created.append(f"{title} ({date})")
            except Exception as e:
                failed.append(f"{title} ({date}): {str(e)[:80]}")
        del data[eid]

    _save_pending_school_events(data)

Technical Analysis

The intended workflow is documented as:

  1. Fetch an externally supplied school email.
  2. Extract proposed events.
  3. Store those events in a pending queue.
  4. Obtain confirmation from the family.
  5. Create the corresponding Google ...[truncated 3058 chars]
Remediation
View remediation

Remediation Suggestions

  1. Generate a cryptographically random, single-use approval nonce when pending events are proposed.
  2. Bind the nonce to:
    • The specific pending queue entry.
    • A digest of the exact event fields.
    • The authorized family member or conversation.
    • A short expiration time.
  3. Require the nonce when calling confirm_pending_school_events and reject missing, expired, reused, or mismatched approvals.
  4. Remove the implicit confirm-all behavior. Require explicit queue identifiers, or require a separate approval covering the exact set of entries.
  5. Validate the approving sender against an allowlist of authorized family identities supplied by the trusted messaging layer.
  6. Separate proposal data from approval state and record approval metadata before calendar creation.
  7. Delete a queue entry only after all corresponding writes succeed. Retain failed events with an explicit failure state so they can be reviewed or retried.
  8. Add tests proving that direct calls without valid approval evidence cannot reach create_event.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (162)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CHANGELOG.md (reported line 21)May include surrounding context.

md
`confirm_pending_school_events` is the one calendar write homebase still makes.
- `core/keychain_secrets.py`, `core/reauth_google.py`, `migrate_to_keychain.py`
  and the `.env` they read. The skill now holds no credentials at all: `gog`
  owns the OAuth refresh token and mints an access token per invocation.
- Dependencies `google-api-python-client`, `google-auth`, `google-auth-httplib2`,
  `google-auth-oauthlib`, `keyring` and `python-dotenv`. Only `requests` and
  `pypdf` remain.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 147)May include surrounding context.

md
`confirm_pending_school_events` is the one calendar write homebase still makes.
- `core/keychain_secrets.py`, `core/reauth_google.py`, `migrate_to_keychain.py`
  and the `.env` they read. The skill now holds no credentials at all: `gog`
  owns the OAuth refresh token and mints an access token per invocation.
- Dependencies `google-api-python-client`, `google-auth`, `google-auth-httplib2`,
  `google-auth-oauthlib`, `keyring` and `python-dotenv`. Only `requests` and
  `pypdf` remain.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a broad family household coordinator focused on calendar, meals, school email, groceries, health logs, and receipts, but this code specifically implements a Gmail-based bill watcher for utility/subscription emails. Its primary purpose is bill retrieval and extraction, which is not mentioned in the declared description. It accesses Gmail, parses message bodies and PDF attachments, and stores bill-processing state in household bill files. While 'receipts' is somewhat adjacent, bill monitoring is a distinct capability and appears to be the actual core behavior of this chunk. Therefore the description does not accurately represent this code's behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The code is related to one slice of the declared domain—family calendar coordination—but it does not match the broader declared description closely. Its actual behavior is narrowly focused on Google Calendar sync/caching and a WhatsApp-focused household assistant framing, plus an undeclared side effect: detecting restaurant-related events and writing visit logs through the dining tracker. The description also explicitly states that every tool goes through tools.py, but this code directly imports and calls core.gcal and features.dining.restaurant_tracker, which contradicts that architectural claim. There is no evidence here of handling school email, groceries, health logs, receipts, or kids' meals in this chunk. Because the code includes undeclared write behavior and bypasses the stated tool-routing approach, this is a meaningful description-versus-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared description is broad household coordination with receipts as one item, but this specific code chunk has a substantially different concrete purpose: it is a batch media ingestion/watcher pipeline for inbound images. It accesses undeclared resources (local inbound media directory and state JSON), performs undeclared capabilities (directory scanning, sidecar caption parsing, content hashing, deduplication, image keyword classification, reminder retrieval), and supports school snack image processing and restaurant reminder surfacing. While receipts and kids' meals/snacks loosely overlap the household domain, the primary behavior here is not general family coordination and it explicitly does not route actions through tools.py in this module. That makes the description materially inaccurate for this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description is broad household coordination, but this code chunk has a much narrower and different primary purpose: restaurant/dining tracking. Some overlap exists with receipts and calendar usage, so it is plausibly part of a larger household skill, but the implemented capabilities here materially extend into restaurant analytics, ratings, recommendations, and dining-specific reminders that are not represented in the declared description. The description also says every tool goes through tools.py, while this file exposes direct callable functions and a CLI entrypoint. No obviously dangerous undeclared external access appears beyond local JSON persistence and config reads, but the feature set is still mismatched enough to flag.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad family household coordinator, including school email among many household tasks, but this specific code chunk has a much narrower and materially different purpose: extracting and storing image attachments from school/email messages. It directly accesses Gmail attachments and the local filesystem, capabilities not declared in the provided permissions and not described as the main behavior. It also appears inconsistent with the architectural claim that every tool goes through tools.py, since it imports core.gmail directly. While school email is mentioned in the description, the actual code is an attachment download/storage utility rather than a general household coordination or calendar feature, so this is a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents a broad household coordinator, but this code chunk is a narrowly focused travel-status module. Its primary purpose is to parse calendar events and infer whether the family is away, the destination, trip day counts, and weather-location behavior for briefings. While this is adjacent to calendar/briefing functionality, it is a materially more specific capability not represented in the declared description. Additionally, the description explicitly says every tool goes through tools.py, but this file directly imports and uses FamilyCalendarAggregator and config loading to access/sync calendar data, which is inconsistent with that declared access pattern.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description presents a broad household coordinator centered on calendars, meals, school email, groceries, health logs, and receipts. The supplied code instead has a specific and materially different primary purpose: identifying likely trips from calendar events and assembling trip-prep context. It accesses calendar data, household profile files, and external weather/geocoding-related functionality, plus maintains a trip-prep dedup log. While 'calendar' and family context are loosely related to the declared household domain, the concrete behavior here is a distinct trip-preparation subsystem that is not disclosed in the declared purpose. The code also directly performs functionality beyond a generic coordinator summary, especially travel intelligence and weather lookup, so this is a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a feature-rich household coordination skill, but the provided code chunk is only a minimal tests/init.py file with no operative behavior beyond marking a Python package. This is a material mismatch because the code does not implement, expose, or support the stated primary purpose or capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code does not implement a general family household coordinator spanning calendar, meal planning, school email, groceries, health logs, or receipts. Instead, it is narrowly focused on bill-watching behavior: fetching billing emails from Gmail, parsing bodies/HTML, extracting PDF text, deduplicating message IDs, handling auth-error notification state, and exposing bill-specific tool wrappers and CLI behavior. While 'school email' or 'receipts' might loosely involve email, this code is specifically about utility/biller email ingestion and delivery workflow, which is a materially different primary purpose and an undeclared capability relative to the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a household-management skill with operational features like calendar coordination, meals, school email, groceries, health logs, and receipts. The supplied code does not implement any of those end-user capabilities. Instead, it is a test file focused narrowly on the CLI contract of tools.py, using subprocesses to verify JSON parsing and error behavior. While the comments reference household-related tool names, the actual behavior neither manages household data nor provides the declared coordinator functionality. This is therefore a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a broad household coordination skill focused on calendars, family briefings, meals, school email, groceries, health logs, and receipts. The supplied code, however, is specifically a test module for a daily_thought feature that fetches quotes from ZenQuotes, formats them, unescapes HTML entities, and falls back on failures. While 'briefings' could loosely include a daily thought, the concrete behavior here centers on an external quote service and resilience logic for that service, which is not disclosed in the description. Additionally, the description explicitly says every tool goes through tools.py, but this code validates direct urllib.request.urlopen usage instead. That makes the implementation materially different from the declared behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The supplied code is not a general household coordinator implementation; it is a targeted test suite for a Google Calendar boundary module. Its concrete behavior is limited to validating subprocess calls and parsing/error handling for calendar operations. While calendar support is one part of the declared description, the statement that every tool goes through tools.py is not reflected here, and the broader multi-domain household functionality is absent. This indicates the declared description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The supplied code does not implement a general household coordinator for calendars, school email, groceries, health logs, or tool routing through tools.py. Instead, it tests a specific media-watching workflow focused on inbound image files, caption keyword classification, receipt/snack handling, and state persistence. While receipt-related processing loosely overlaps with the declared description, the primary behavior is materially different and includes undeclared media scanning/classification capabilities. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a broad household coordination skill focused on family management tasks such as calendars, meals, school email, groceries, health logs, and receipts. The supplied code chunk, however, is specifically a smoke test file for PDF attachment utilities. Its behavior is narrowly about validating PDF text extraction and locating PDF attachments in multipart payloads. That is a materially different primary purpose from the declared household coordinator role. While receipts or school email could conceivably involve PDFs, this code chunk does not implement those end-user household functions; it only tests low-level PDF/email attachment processing. Therefore the description does not accurately represent this code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad household coordination skill centered on family management tasks such as calendars, meals, school email, groceries, health logs, and receipts. The supplied code, however, is narrowly focused on restaurant tracking behavior: detecting meal types, logging restaurant visits, merging duplicate visit records, collecting family ratings, extracting restaurant names from calendar titles, and recommending restaurants based on ratings. While there is a loose thematic overlap with calendars, meals, and receipts, the actual implemented/tested capability is specifically a dining/restaurant tracker rather than a general household coordinator. No evidence here supports school email, groceries, health logging, briefings, or generic tool-routing via tools.py. This is a material description-behavior mismatch in primary purpose and concrete capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad household coordinator skill with user-facing functions like calendar management, school email, groceries, health logs, and receipts. The supplied code chunk, however, is narrowly focused on backend tests for email/image attachment extraction and filesystem cleanup related to school calendar sync. While school email/calendar is adjacent to the declared domain, the actual code's primary purpose is low-level Gmail attachment handling and local file management, not the broader coordinator behavior described. It also directly patches core.gmail.get_attachment, which does not align with the claim that every tool goes through tools.py. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents an end-user household coordination skill. The supplied code chunk does not implement household coordination features such as calendar management, meal planning, school email handling, groceries, health logs, or receipts. Instead, it is a developer-facing test suite for documentation integrity and repo configuration drift. This is a materially different primary purpose, not merely a supporting detail. No household-facing triggers or tool-routing behavior appear in the code; the code reads local files and asserts documentation matches implementation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents an end-user household coordination skill with operational family-management features. The supplied code does not implement those user-facing capabilities; instead, it implements internal test safeguards to ensure library code does not print to stdout and that JSON-returning tools remain parseable. While the comments reference family-facing briefings and tools.py, this chunk’s primary purpose is test/QA infrastructure, which is materially different from the declared skill behavior. This is a description-behavior mismatch, though it does not indicate malicious or risky hidden capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents an end-user household coordination skill with operational features like calendar management, meals, groceries, school email, and health/receipt tracking. The supplied code does not implement any of those household functions. Instead, it is an internal test that audits whether tool documentation matches the dispatch table in tools.py and whether agent.md contains accurate per-tool argument references. This is a materially different primary purpose from the declared skill behavior, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad household coordination skill, but this specific code chunk implements and validates a specialized travel-detection subsystem. While travel logic could support family briefings or calendar features, the actual code focuses narrowly on determining whether the family is away, where they are, and what weather location should be used. It does not reflect the broader declared functions like meals, school email, groceries, health logs, or receipts, and it introduces a concrete capability—travel/window inference and destination/weather handling—not explicitly represented in the description. This is a material description-behavior mismatch in primary purpose for the supplied chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The supplied code chunk does not implement a general household coordinator as described. Instead, it tests a specialized trips feature centered on detecting trip-like calendar events, tagging environments such as beach/mountain/desert, storing kid observations relevant to travel, and tracking whether trip-prep messages were already sent. While there is slight overlap with the declared domains of calendar and health log, the primary purpose is materially different: trip detection/prep rather than broad family coordination across meals, school email, groceries, receipts, and briefings. The description also explicitly states that every tool goes through tools.py, but the tested behavior indicates direct file I/O paths for profiles and sent logs and use of urllib geocoding, which is inconsistent with that declared architecture. Therefore this is a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a broad family household coordinator focused on calendars, meals, school email, groceries, health logs, receipts, and briefings, plus a note that tool calls go through tools.py. The supplied code chunk does not implement or invoke those household-management capabilities. Instead, it is exclusively a unit test file for weather-related functionality in features.briefing.weather. It exercises network-facing weather/geocoding behavior, retry logic, rain timing logic, and weather context handling. While 'briefings' is mentioned in the description, this code is narrowly about weather briefings and supporting weather infrastructure, not the broader household coordinator behavior described. It also references direct urllib usage in the tested functionality rather than demonstrating the declared tools.py mediation. This is a material description/behavior mismatch rather than a mere supporting detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad household coordination skill spanning calendars, school email, groceries, health logs, receipts, and kids' meals. The supplied code chunk, however, is narrowly focused on testing a weekly meal planner module. It verifies meal-plan generation rules, pending and locked JSON file handling, approval/revision commands, and date-based meal lookup. That is a materially different actual behavior from the broad multi-domain coordinator described. Additionally, the description says every tool goes through tools.py, but this code directly exercises module functions and file paths, with no evidence of the claimed tool mediation. While kids' meals are one part of the declared scope, this code is much more specific and includes undeclared approval/persistence behaviors, so the description does not accurately represent this chunk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.